Search
lxdream.org :: lxdream/src/lxpaths.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/lxpaths.c
changeset 1056:d0896e6530d6
prev1041:5fcc39857c5c
next1205:a486ac64f34b
author nkeynes
date Sun Jun 28 12:07:21 2009 +0000 (11 years ago)
permissions -rw-r--r--
last change Fix handling of rename failure
Fix boneheadedness in get_filename_at
file annotate diff log raw
1.1 --- a/src/lxpaths.c Fri Jun 26 05:47:04 2009 +0000
1.2 +++ b/src/lxpaths.c Sun Jun 28 12:07:21 2009 +0000
1.3 @@ -120,12 +120,12 @@
1.4 gchar *get_filename_at( const gchar *at, const gchar *filename )
1.5 {
1.6 char tmp[PATH_MAX];
1.7 - char *p = strrchr( filename, '/' );
1.8 + char *p = strrchr( at, '/' );
1.9 if( p == NULL ) {
1.10 /* No path at all, so just return filename */
1.11 return g_strdup(filename);
1.12 } else {
1.13 - int off = p-filename;
1.14 + int off = p-at;
1.15 return g_strdup_printf("%.*s%c%s", off, at, G_DIR_SEPARATOR, filename );
1.16 }
1.17 }
.