Ticket #4533: 4533_ext_editor_cmd_line_args.patch

File 4533_ext_editor_cmd_line_args.patch, 683 bytes (added by Dhalgren, 9 months ago)
  • lib/utilunix.c

    diff -ru a/lib/utilunix.c b/lib/utilunix.c
    a b  
    218218        if (shell_token == NULL) 
    219219            *execute_name = g_strdup (shell); 
    220220        else 
     221        { 
    221222            *execute_name = g_strndup (shell, (gsize) (shell_token - shell)); 
     223            shell_token++; 
     224        } 
    222225 
    223         g_ptr_array_add (args_array, (gpointer) shell); 
     226        g_ptr_array_add (args_array, (gpointer) *execute_name); 
     227        if (shell_token != NULL) 
     228        { 
     229            g_ptr_array_add (args_array, (gpointer) shell_token); 
     230        } 
    224231    } 
    225232    return args_array; 
    226233}