Przeglądaj źródła

Don't trim string arguments to CLI.

For #307.
Matt Clarkson 12 lat temu
rodzic
commit
7cf611a2dd

+ 5 - 7
Libs/CommandLineModules/Backend/LocalProcess/ctkCmdLineModuleBackendLocalProcess.cpp

@@ -94,14 +94,11 @@ struct ctkCmdLineModuleBackendLocalProcessPrivate
           {
             foreach(QString arg, args)
             {
-
-              QString trimmedArg = arg.trimmed();
-
               if (parameter.tag() == "string")
               {
-                if (trimmedArg.length() != 0)
+                if (arg.length() != 0)
                 {
-                  cmdLineArgs << argFlag << trimmedArg;
+                  cmdLineArgs << argFlag << arg;
                 }
                 else
                 {
@@ -110,9 +107,10 @@ struct ctkCmdLineModuleBackendLocalProcessPrivate
               }
               else
               {
-                if (trimmedArg.length() != 0) // If not string, no arg, we don't output. We need this policy for integers, doubles, etc.
+                QString trimmedArg = arg.trimmed();
+                if (trimmedArg.length() != 0) // If not string, and no arg, we don't output. We need this policy for integers, doubles, etc.
                 {
-                  cmdLineArgs << argFlag << arg;
+                  cmdLineArgs << argFlag << trimmedArg;
                 }
               }
             } // end foreach