return ( 0 );
}
+ if ( options & PND_EXEC_OPTION_INFO && ! reserved ) {
+ return ( 0 );
+ }
+
// determine path to pnd-file
sprintf ( fullpath, "%s/%s", app -> object_path, app -> object_filename );
argv [ f++ ] = "-p";
argv [ f++ ] = fullpath;
argv [ f++ ] = "-e";
- argv [ f++ ] = app -> exec;
+ if ( options & PND_EXEC_OPTION_INFO ) {
+ argv [ f++ ] = ((pnd_apps_exec_info_t*)reserved) -> viewer;
+ } else {
+ argv [ f++ ] = app -> exec;
+ }
if ( app -> startdir ) {
argv [ f++ ] = "-s";
argv [ f++ ] = app -> startdir;
}
- if ( app -> execargs ) {
- argv [ f++ ] = "-a";
- argv [ f++ ] = app -> execargs;
+ if ( options & PND_EXEC_OPTION_INFO ) {
+ if ( ((pnd_apps_exec_info_t*)reserved) -> args ) {
+ argv [ f++ ] = "-a";
+ argv [ f++ ] = ((pnd_apps_exec_info_t*)reserved) -> args;
+ }
+ } else {
+ if ( app -> execargs ) {
+ argv [ f++ ] = "-a";
+ argv [ f++ ] = app -> execargs;
+ }
}
if ( app -> appdata_dirname ) {
argv [ f++ ] = "-b";
argv [ f++ ] = "-b";
argv [ f++ ] = app -> unique_id;
}
- if ( app -> clockspeed ) {
- argv [ f++ ] = "-c";
- argv [ f++ ] = app -> clockspeed;
+
+ if ( options & PND_EXEC_OPTION_INFO ) {
+ // we don't need to overclock for showing info :) do we? crazy active .js pages maybe?
+ } else {
+ if ( app -> clockspeed ) {
+ argv [ f++ ] = "-c";
+ argv [ f++ ] = app -> clockspeed;
+ }
}
// skip -a (arguments) for now
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
- if ( strcmp ( argv [ i ], "-a" ) == 0 ) {
+ // 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
} else {
// child, do it
execv ( pndrun, argv );
- }
+ }
// by definition, either error occurred or we are the original application.
return ( 1 );
}
+