From 51ae72aba105e16a9bb50c71db3ba73372ace0c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1z=20Zengin?= Date: Thu, 4 Sep 2025 21:35:16 +0300 Subject: [PATCH] pmt: add control for -l flag --- src/PartitionManager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/PartitionManager.cpp b/src/PartitionManager.cpp index b7dbfec..cbaf8e7 100644 --- a/src/PartitionManager.cpp +++ b/src/PartitionManager.cpp @@ -75,7 +75,7 @@ static Helper::garbageCollector collector; int Main(int argc, char **argv) { try { // try-catch start - Helper::LoggingProperties::setProgramName("pmt"); + Helper::LoggingProperties::setProgramName(argv[0]); collector.closeAfterProgress(pstdout); collector.closeAfterProgress(pstderr); @@ -145,6 +145,11 @@ int Main(int argc, char **argv) { "directory with -S " "(--search-path)"); + if (Variables->onLogical) { + if (!Variables->PartMap->hasLogicalPartitions()) + throw Error("This device doesn't contains logical partitions. But you used -l (--logical) flag."); + } + if (!Helper::hasSuperUser()) { if (!((FuncManager.isUsed("rebootFunction") && Helper::hasAdbPermissions()) ||