]> Pileus Git - ~andy/gtk/blobdiff - gdk-pixbuf/gdk-pixbuf-csource.c
Apply a cleanup patch by Kjartan Maraas (#341812)
[~andy/gtk] / gdk-pixbuf / gdk-pixbuf-csource.c
index 29669c8a09e419feed007b9220ddf5182376cce0..b8c7bbffe2ae001d24b1c03f444c79fddb2990fd 100644 (file)
@@ -16,7 +16,7 @@
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
-#include "config.h"
+#include <config.h>
 
 #include "../gtk/gtkversion.h" /* versioning */
 #include "gdk-pixbuf.h"
@@ -75,6 +75,7 @@ main (int   argc,
 {
   GdkPixbuf *pixbuf;
   GError *error = NULL;
+  gchar *infilename;
 
   /* initialize glib/GdkPixbuf */
   g_type_init ();
@@ -90,7 +91,13 @@ main (int   argc,
          return 1;
        }
       
-      pixbuf = gdk_pixbuf_new_from_file (argv[1], &error);
+#ifdef G_OS_WIN32
+      infilename = g_locale_to_utf8 (argv[1], -1, NULL, NULL, NULL);
+#else
+      infilename = argv[1];
+#endif
+
+      pixbuf = gdk_pixbuf_new_from_file (infilename, &error);
       if (!pixbuf)
        {
          g_fprintf (stderr, "failed to load \"%s\": %s\n",
@@ -111,11 +118,20 @@ main (int   argc,
 
       while (j--)
        {
+#ifdef G_OS_WIN32
+         infilename = g_locale_to_utf8 (*p, -1, NULL, NULL, NULL);
+#else
+         infilename = *p;
+#endif
+
          if (!toggle)
-           image_name = *p++;
+           {
+             image_name = infilename;
+             p++;
+           }
          else
            {
-             pixbuf = gdk_pixbuf_new_from_file (*p, &error);
+             pixbuf = gdk_pixbuf_new_from_file (infilename, &error);
              if (!pixbuf)
                {
                  g_fprintf (stderr, "failed to load \"%s\": %s\n",
@@ -256,7 +272,7 @@ print_blurb (FILE    *bout,
   if (!print_help)
     {
       g_fprintf (bout, "%s version ", PRG_NAME);
-      g_fprintf (bout, "%u.%u.%u", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
+      g_fprintf (bout, "%d.%d.%d", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
       g_fprintf (bout, "\n");
       g_fprintf (bout, "%s comes with ABSOLUTELY NO WARRANTY.\n", PRG_NAME);
       g_fprintf (bout, "You may redistribute copies of %s under the terms of\n", PRG_NAME);