summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3bdf3f3)
raw | patch | inline | side by side (parent: 3bdf3f3)
author | joncruz <joncruz@users.sourceforge.net> | |
Tue, 16 Sep 2008 04:42:01 +0000 (04:42 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Tue, 16 Sep 2008 04:42:01 +0000 (04:42 +0000) |
src/main.cpp | patch | blob | history |
diff --git a/src/main.cpp b/src/main.cpp
index aac33b155294aab4c108f9d8812bb05ac216afca..f8c87b5a621a95277f04246f99fb1f58ddc79518 100644 (file)
--- a/src/main.cpp
+++ b/src/main.cpp
if ( strcmp(useme, "quit") == 0 ) {
// Time to quit
fflush(stdout);
- exit(0);
+ linedata = 0; // mark for exit
} else if ( len < 1 ) {
// blank string. Do nothing.
} else {
GError* parseError = 0;
gchar** argv = 0;
gint argc = 0;
- // add a dummy "inkscape" in front, as popt expects the program name there:
- gchar *cl = g_strdup_printf ("inkscape %s", useme);
- if ( g_shell_parse_argv(cl, &argc, &argv, &parseError) ) {
+ if ( g_shell_parse_argv(command_line, &argc, &argv, &parseError) ) {
poptContext ctx = poptGetContext(NULL, argc, const_cast<const gchar**>(argv), options, 0);
poptSetOtherOptionHelp(ctx, _("[OPTIONS...] [FILE...]\n\nAvailable options:"));
if ( ctx ) {
} else {
g_warning("problem parsing commandline: %s", useme);
}
- g_free(cl);
}
}
} // if (linedata...
if (sp_shell) {
sp_main_shell(argv[0]); // Run as interactive shell
+ exit(0);
} else {
sp_process_file_list(fl); // Normal command line invokation
}