summaryrefslogtreecommitdiff
path: root/src/glib-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glib-utils.c')
-rw-r--r--src/glib-utils.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/glib-utils.c b/src/glib-utils.c
index 2f9c02e..08dcb5c 100644
--- a/src/glib-utils.c
+++ b/src/glib-utils.c
@@ -240,7 +240,7 @@ g_utf8_strchug (char *string)
c = g_utf8_get_char (scan);
}
- g_memmove (string, scan, strlen (scan) + 1);
+ memmove (string, scan, strlen (scan) + 1);
return string;
}
@@ -363,7 +363,7 @@ eat_spaces (const char *line)
{
if (line == NULL)
return NULL;
- while ((*line == ' ') && (*line != 0))
+ while (*line == ' ')
line++;
return line;
}
@@ -390,6 +390,10 @@ split_line (const char *line,
fields[i] = g_strndup (scan, field_end - scan);
scan = eat_spaces (field_end);
}
+ else if (scan != NULL && i == n_fields - 1)
+ {
+ fields[i] = g_strdup (scan);
+ }
}
return fields;
@@ -510,6 +514,9 @@ _g_path_get_base_name (const char *path,
if (junk_paths)
return _g_path_get_file_name (path);
+ if (base_dir == NULL)
+ return (path[0] == '/') ? path + 1 : path;
+
base_dir_len = strlen (base_dir);
if (strlen (path) < base_dir_len)
return NULL;