From: Tor Lillqvist Date: Fri, 1 Oct 2004 20:12:50 +0000 (+0000) Subject: Use g_path_get_basename() instead of strrchr(), so that either slash is X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=1c1fb907696e9fea5a881f647fd919bc10377b1a;p=dana%2Fcg-glib.git Use g_path_get_basename() instead of strrchr(), so that either slash is 2004-10-01 Tor Lillqvist * glib/goption.c (g_option_context_parse): Use g_path_get_basename() instead of strrchr(), so that either slash is accepted on Windows. --- diff --git a/ChangeLog b/ChangeLog index ec5451a7..07720e9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-10-01 Tor Lillqvist + + * 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 * glib/gfileutils.c: Convert filenames to UTF-8 before diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index ec5451a7..07720e9e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2004-10-01 Tor Lillqvist + + * 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 * glib/gfileutils.c: Convert filenames to UTF-8 before diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index ec5451a7..07720e9e 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,9 @@ +2004-10-01 Tor Lillqvist + + * 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 * glib/gfileutils.c: Convert filenames to UTF-8 before diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index ec5451a7..07720e9e 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +2004-10-01 Tor Lillqvist + + * 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 * glib/gfileutils.c: Convert filenames to UTF-8 before diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index ec5451a7..07720e9e 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2004-10-01 Tor Lillqvist + + * 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 * glib/gfileutils.c: Convert filenames to UTF-8 before diff --git a/glib/goption.c b/glib/goption.c index 155cad2c..3682b019 100644 --- a/glib/goption.c +++ b/glib/goption.c @@ -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 {