Browse Source

nsm-proxy: Don't die if arguments are missing.

tags/non-daw-v1.2.0
Jonathan Moore Liles 13 years ago
parent
commit
16f8956f8d
2 changed files with 12 additions and 2 deletions
  1. +3
    -0
      session-manager/src/nsm-proxy-gui.C
  2. +9
    -2
      session-manager/src/nsm-proxy.C

+ 3
- 0
session-manager/src/nsm-proxy-gui.C View File

@@ -105,6 +105,9 @@ handle_kill ( Fl_Widget *o, void *v )
void
handle_start ( Fl_Widget *o, void *v )
{
lo_send_from( nsmp_addr, losrv, LO_TT_IMMEDIATE, "/nsm/proxy/label", "s",
ui->label_input->value() );

lo_send_from( nsmp_addr, losrv, LO_TT_IMMEDIATE, "/nsm/proxy/start", "ss",
ui->executable_input->value(),
ui->arguments_input->value() );


+ 9
- 2
session-manager/src/nsm-proxy.C View File

@@ -87,7 +87,11 @@ public:
free( _arguments );

_executable = strdup( executable );
_arguments = strdup( arguments );

if ( arguments )
_arguments = strdup( arguments );
else
_arguments = NULL;

return start();
}
@@ -106,7 +110,10 @@ public:
// char *args[] = { strdup( executable ), NULL };

char *cmd;
asprintf( &cmd, "exec %s %s", _executable, _arguments );
if ( _arguments )
asprintf( &cmd, "exec %s %s", _executable, _arguments );
else
asprintf( &cmd, "exec %s", _executable );

char *args[] = { _executable, "-c", cmd, NULL };


Loading…
Cancel
Save