+ // stop here?
+ if ( options & PND_EXEC_OPTION_NORUN ) {
+ unsigned char i;
+ bzero ( apps_exec_runline, 1024 );
+ //pnd_log ( PND_LOG_DEFAULT, "Norun %u\n", f );
+ unsigned char quotenext = 0;
+ for ( i = 0; i < ( f - 1 ); i++ ) {
+ //pnd_log ( PND_LOG_DEFAULT, "Norun %u: %s\n", i, argv [ i ] );
+
+ // add spacing between args
+ if ( i > 0 ) {
+ strncat ( apps_exec_runline, " ", 1000 );
+ }
+
+ // quoting
+ if ( quotenext ) {
+ strncat ( apps_exec_runline, "\"", 1000 );
+ }
+
+ // arg
+ strncat ( apps_exec_runline, argv [ i ], 1000 );
+
+ // unquoting
+ if ( quotenext ) {
+ strncat ( apps_exec_runline, "\"", 1000 );
+ }
+
+ // clear quoting
+ if ( quotenext ) {
+ quotenext = 0;
+ } else {
+ // deprecated; need to handle spaces in some additional args
+ // if ( strcmp ( argv [ i ], "-a" ) == 0 ) {
+ // if this is for -a, we need to wrap with quotes
+ // ivanovic:
+ // to allow spaces in filenames we have to add quotes around most terms!
+ // terms with quotes:
+ // -a additional arguments
+ // -p fullpath to pnd
+ // -e name of execuatable inside the pnd
+ // -s startdir
+ // -b name for the appdir
+
+ if ( ( strcmp ( argv [ i ], "-a" ) == 0 ) ||
+ ( strcmp ( argv [ i ], "-p" ) == 0 ) ||
+ ( strcmp ( argv [ i ], "-e" ) == 0 ) ||
+ ( strcmp ( argv [ i ], "-s" ) == 0 ) ||
+ ( strcmp ( argv [ i ], "-b" ) == 0 ) )
+ {
+ quotenext = 1;
+ }
+
+ }
+
+ } // for
+ return ( 1 );
+ }
+