diff options
author | Sebastian Wilhelmi <wilhelmi@ira.uka.de> | 2000-07-20 16:58:54 +0000 |
---|---|---|
committer | Sebastian Wilhelmi <wilhelmi@src.gnome.org> | 2000-07-20 16:58:54 +0000 |
commit | fec9828ac62918374fb8aa94e15a9bdf554e269e (patch) | |
tree | 7f327de3ead1d7355b5fa6144d6e264afb34e4e9 /gwin32.c | |
parent | 84114c5321e4d7e4701f77f7f0e2b9b739d4035c (diff) | |
download | glib-fec9828ac62918374fb8aa94e15a9bdf554e269e.tar.gz |
Mark the functions g_basename and g_dirname deprecated. They will issue an
2000-07-20 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gutils.c, glib.h: Mark the functions g_basename and g_dirname
deprecated. They will issue an warning once, when compiled with
G_ENABLE_DEBUG, but continue to work as before. Instead the
functions g_path_get_basename and g_path_get_dirname should be
used, which BOTH return newly allocated memory, that has to freed
by g_free. The new g_path_get_basename now strips trailing slashes
from the path. This fixes #5097. For discussion see
http://mail.gnome.org/pipermail/gtk-devel-list/2000-April/003139.html
* gwin32.c, testglib.c, tests/dirname-test.c: Use the new
functions instead of the old ones.
* gmodule/libgplugin_a.c, gmodule/testgmodule.c: Use
g_path_get_basename instead of the deprecated g_basename.
Diffstat (limited to 'gwin32.c')
-rw-r--r-- | gwin32.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -131,6 +131,7 @@ struct dirent* g_win32_readdir (DIR *dir) { static struct dirent result; + gchar *basename; g_return_val_if_fail (dir != NULL, NULL); @@ -153,7 +154,12 @@ g_win32_readdir (DIR *dir) } } } - strcpy (result.d_name, g_basename (((LPWIN32_FIND_DATA) dir->find_file_data)->cFileName)); + + basename = g_path_get_basename (((LPWIN32_FIND_DATA) dir->find_file_data)->cFileName); + + strcpy (result.d_name, basename); + + g_free (basename); return &result; } |