Use g_path_get_basename() instead of strrchr(), so that either slash is
authorTor Lillqvist <tml@iki.fi>
Fri, 1 Oct 2004 20:12:50 +0000 (20:12 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Fri, 1 Oct 2004 20:12:50 +0000 (20:12 +0000)
2004-10-01  Tor Lillqvist  <tml@iki.fi>

* glib/goption.c (g_option_context_parse): Use
g_path_get_basename() instead of strrchr(), so that either slash
is accepted on Windows.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/goption.c

index ec5451a74587e7090aa5b5f7da7ed1a58d30f18e..07720e9e7c42c592b07623734739d1d95f91d0e6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-01  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/goption.c (g_option_context_parse): Use
+       g_path_get_basename() instead of strrchr(), so that either slash
+       is accepted on Windows.
+
 2004-09-30  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/gfileutils.c: Convert filenames to UTF-8 before 
index ec5451a74587e7090aa5b5f7da7ed1a58d30f18e..07720e9e7c42c592b07623734739d1d95f91d0e6 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-01  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/goption.c (g_option_context_parse): Use
+       g_path_get_basename() instead of strrchr(), so that either slash
+       is accepted on Windows.
+
 2004-09-30  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/gfileutils.c: Convert filenames to UTF-8 before 
index ec5451a74587e7090aa5b5f7da7ed1a58d30f18e..07720e9e7c42c592b07623734739d1d95f91d0e6 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-01  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/goption.c (g_option_context_parse): Use
+       g_path_get_basename() instead of strrchr(), so that either slash
+       is accepted on Windows.
+
 2004-09-30  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/gfileutils.c: Convert filenames to UTF-8 before 
index ec5451a74587e7090aa5b5f7da7ed1a58d30f18e..07720e9e7c42c592b07623734739d1d95f91d0e6 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-01  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/goption.c (g_option_context_parse): Use
+       g_path_get_basename() instead of strrchr(), so that either slash
+       is accepted on Windows.
+
 2004-09-30  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/gfileutils.c: Convert filenames to UTF-8 before 
index ec5451a74587e7090aa5b5f7da7ed1a58d30f18e..07720e9e7c42c592b07623734739d1d95f91d0e6 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-01  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/goption.c (g_option_context_parse): Use
+       g_path_get_basename() instead of strrchr(), so that either slash
+       is accepted on Windows.
+
 2004-09-30  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/gfileutils.c: Convert filenames to UTF-8 before 
index 155cad2c19cc939dfa883ac3f76008facb7cb504..3682b0196a0a77c1598ad1f6ec3908d725c0c910 100644 (file)
@@ -828,13 +828,9 @@ g_option_context_parse (GOptionContext   *context,
     {
       gchar *prgname;
       
-      prgname = strrchr ((*argv)[0], G_DIR_SEPARATOR);
-      if (prgname)
-       prgname++;
-      else
-       prgname = (*argv)[0];
-
+      prgname = g_path_get_basename ((*argv)[0]);
       g_set_prgname (prgname);
+      g_free (prgname);
     }
   else
     {