X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fopenbox;a=blobdiff_plain;f=openbox%2Fopenbox.c;h=cba0499533573ddfc777497e79cd5bc6d8c0e41c;hp=a7eb6a282fdb60c14b59e58d28d82e63536bb0d0;hb=HEAD;hpb=5fdb5cb7ddc18c1c00fa79472d2e199ab8570a06 diff --git a/openbox/openbox.c b/openbox/openbox.c index a7eb6a28..cba04995 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -224,6 +224,7 @@ gint main(gint argc, gchar **argv) event_reset_time(); do { + gchar *xml_error_string = NULL; ObPrompt *xmlprompt = NULL; if (reconfigure) obt_keyboard_reload(); @@ -264,6 +265,14 @@ gint main(gint argc, gchar **argv) else OBT_PROP_ERASE(obt_root(ob_screen), OB_CONFIG_FILE); + if (obt_xml_last_error(i)) { + xml_error_string = g_strdup_printf( + _("One or more XML syntax errors were found while parsing the Openbox configuration files. See stdout for more information. The last error seen was in file \"%s\" line %d, with message: %s"), + obt_xml_last_error_file(i), + obt_xml_last_error_line(i), + obt_xml_last_error_message(i)); + } + /* we're done with parsing now, kill it */ obt_xml_instance_unref(i); } @@ -362,17 +371,12 @@ gint main(gint argc, gchar **argv) reconfigure = FALSE; /* look for parsing errors */ - { - xmlErrorPtr e = xmlGetLastError(); - if (e) { - gchar *m; - - m = g_strdup_printf(_("One or more XML syntax errors were found while parsing the Openbox configuration files. See stdout for more information. The last error seen was in file \"%s\" line %d, with message: %s"), e->file, e->line, e->message); - xmlprompt = - prompt_show_message(m, _("Openbox Syntax Error"), _("Close")); - g_free(m); - xmlResetError(e); - } + if (xml_error_string) { + xmlprompt = prompt_show_message(xml_error_string, + _("Openbox Syntax Error"), + _("Close")); + g_free(xml_error_string); + xml_error_string = NULL; } g_main_loop_run(ob_main_loop); @@ -515,9 +519,9 @@ static void print_version(void) { g_print("Openbox %s\n", PACKAGE_VERSION); g_print(_("Copyright (c)")); - g_print(" 2008-2011 Mikael Magnusson\n"); + g_print(" 2004 Mikael Magnusson\n"); g_print(_("Copyright (c)")); - g_print(" 2003-2011 Dana Jansens\n\n"); + g_print(" 2002 Dana Jansens\n\n"); g_print("This program comes with ABSOLUTELY NO WARRANTY.\n"); g_print("This is free software, and you are welcome to redistribute it\n"); g_print("under certain conditions. See the file COPYING for details.\n\n"); @@ -576,7 +580,7 @@ static void run_startup_cmd(void) G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, NULL, &e); - if (!g_shell_parse_argv(startup_cmd, NULL, &argv, &e)) { + if (!ok) { g_message("Error launching startup command: %s", e->message); g_error_free(e);