mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-21 14:49:16 +02:00
Merge branch '3003-glib-compile-schemas-failed' into 'main'
glib-compile-resources: Fix non-ASCII arg parsing on Windows Closes #3003 See merge request GNOME/glib!3446
This commit is contained in:
commit
ecbe360a38
@ -837,6 +837,7 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
gchar *tmp;
|
gchar *tmp;
|
||||||
|
gchar **command_line = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
setlocale (LC_ALL, GLIB_DEFAULT_LOCALE);
|
setlocale (LC_ALL, GLIB_DEFAULT_LOCALE);
|
||||||
@ -863,11 +864,21 @@ main (int argc, char **argv)
|
|||||||
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
|
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
command_line = g_win32_get_command_line ();
|
||||||
|
if (!g_option_context_parse_strv (context, &command_line, &error))
|
||||||
|
{
|
||||||
|
g_printerr ("%s\n", error->message);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
argc = g_strv_length (command_line);
|
||||||
|
#else
|
||||||
if (!g_option_context_parse (context, &argc, &argv, &error))
|
if (!g_option_context_parse (context, &argc, &argv, &error))
|
||||||
{
|
{
|
||||||
g_printerr ("%s\n", error->message);
|
g_printerr ("%s\n", error->message);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
g_option_context_free (context);
|
g_option_context_free (context);
|
||||||
|
|
||||||
@ -890,7 +901,11 @@ main (int argc, char **argv)
|
|||||||
compiler_type = get_compiler_id (compiler);
|
compiler_type = get_compiler_id (compiler);
|
||||||
g_free (compiler);
|
g_free (compiler);
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
srcfile = command_line[1];
|
||||||
|
#else
|
||||||
srcfile = argv[1];
|
srcfile = argv[1];
|
||||||
|
#endif
|
||||||
|
|
||||||
xmllint = g_strdup (g_getenv ("XMLLINT"));
|
xmllint = g_strdup (g_getenv ("XMLLINT"));
|
||||||
if (xmllint == NULL)
|
if (xmllint == NULL)
|
||||||
@ -1310,5 +1325,9 @@ main (int argc, char **argv)
|
|||||||
g_free (c_name);
|
g_free (c_name);
|
||||||
g_hash_table_unref (files);
|
g_hash_table_unref (files);
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
g_strfreev (command_line);
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
/* Prologue {{{1 */
|
/* Prologue {{{1 */
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
#include <gstdio.h>
|
#include <gstdio.h>
|
||||||
#include <gi18n.h>
|
#include <gi18n.h>
|
||||||
|
|
||||||
@ -2182,6 +2183,7 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
gchar *tmp = NULL;
|
gchar *tmp = NULL;
|
||||||
|
gchar **command_line = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
setlocale (LC_ALL, GLIB_DEFAULT_LOCALE);
|
setlocale (LC_ALL, GLIB_DEFAULT_LOCALE);
|
||||||
@ -2206,12 +2208,23 @@ main (int argc, char **argv)
|
|||||||
"and the cache file is called gschemas.compiled."));
|
"and the cache file is called gschemas.compiled."));
|
||||||
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
|
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
command_line = g_win32_get_command_line ();
|
||||||
|
if (!g_option_context_parse_strv (context, &command_line, &error))
|
||||||
|
{
|
||||||
|
fprintf (stderr, "%s\n", error->message);
|
||||||
|
retval = 1;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
argc = g_strv_length (command_line);
|
||||||
|
#else
|
||||||
if (!g_option_context_parse (context, &argc, &argv, &error))
|
if (!g_option_context_parse (context, &argc, &argv, &error))
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s\n", error->message);
|
fprintf (stderr, "%s\n", error->message);
|
||||||
retval = 1;
|
retval = 1;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (show_version_and_exit)
|
if (show_version_and_exit)
|
||||||
{
|
{
|
||||||
@ -2227,7 +2240,11 @@ main (int argc, char **argv)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
srcdir = command_line[1];
|
||||||
|
#else
|
||||||
srcdir = argv[1];
|
srcdir = argv[1];
|
||||||
|
#endif
|
||||||
|
|
||||||
target = g_build_filename (targetdir ? targetdir : srcdir, "gschemas.compiled", NULL);
|
target = g_build_filename (targetdir ? targetdir : srcdir, "gschemas.compiled", NULL);
|
||||||
|
|
||||||
@ -2320,6 +2337,7 @@ done:
|
|||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
g_free (tmp);
|
g_free (tmp);
|
||||||
|
g_strfreev (command_line);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user