summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>2000-07-20 16:58:54 +0000
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>2000-07-20 16:58:54 +0000
commitfec9828ac62918374fb8aa94e15a9bdf554e269e (patch)
tree7f327de3ead1d7355b5fa6144d6e264afb34e4e9 /tests
parent84114c5321e4d7e4701f77f7f0e2b9b739d4035c (diff)
downloadglib-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 'tests')
-rw-r--r--tests/dirname-test.c2
-rw-r--r--tests/testglib.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/dirname-test.c b/tests/dirname-test.c
index a4499d5f9..4430aef5e 100644
--- a/tests/dirname-test.c
+++ b/tests/dirname-test.c
@@ -90,7 +90,7 @@ main (int argc,
{
gchar *dirname;
- dirname = g_dirname (dirname_checks[i].filename);
+ dirname = g_path_get_dirname (dirname_checks[i].filename);
g_assert (strcmp (dirname, dirname_checks[i].dirname) == 0);
g_free (dirname);
}
diff --git a/tests/testglib.c b/tests/testglib.c
index 33bb4c9a3..7e3f865e2 100644
--- a/tests/testglib.c
+++ b/tests/testglib.c
@@ -378,12 +378,12 @@ main (int argc,
#endif /* G_HAVE_GINT64 */
g_print ("\n");
- g_print ("checking g_dirname()...");
+ g_print ("checking g_path_get_dirname()...");
for (i = 0; i < n_dirname_checks; i++)
{
gchar *dirname;
- dirname = g_dirname (dirname_checks[i].filename);
+ dirname = g_path_get_dirname (dirname_checks[i].filename);
if (strcmp (dirname, dirname_checks[i].dirname) != 0)
{
g_print ("\nfailed for \"%s\"==\"%s\" (returned: \"%s\")\n",