From 4f5c2e164941d7f1ffd7a81e9048cf8ce50acf2d Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 11 Mar 2012 13:56:14 +0300 Subject: [PATCH] (extfs_get_path_mangle): renamed to extfs_get_path_int and chnaged type of returned value to pointer to constant. Related changes. Signed-off-by: Andrew Borodin --- src/vfs/extfs/extfs.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/vfs/extfs/extfs.c b/src/vfs/extfs/extfs.c index 6c00771f5..b6c52e0d8 100644 --- a/src/vfs/extfs/extfs.c +++ b/src/vfs/extfs/extfs.c @@ -238,11 +238,12 @@ extfs_generate_entry (struct archive *archive, /* --------------------------------------------------------------------------------------------- */ static struct entry * -extfs_find_entry_int (struct entry *dir, char *name, GSList * list, +extfs_find_entry_int (struct entry *dir, const char *name, GSList * list, gboolean make_dirs, gboolean make_file) { struct entry *pent, *pdir; - char *p, *q, *name_end; + const char *p, *name_end; + char *q; char c = PATH_SEP; if (g_path_is_absolute (name)) @@ -323,7 +324,7 @@ extfs_find_entry_int (struct entry *dir, char *name, GSList * list, /* --------------------------------------------------------------------------------------------- */ static struct entry * -extfs_find_entry (struct entry *dir, char *name, gboolean make_dirs, gboolean make_file) +extfs_find_entry (struct entry *dir, const char *name, gboolean make_dirs, gboolean make_file) { struct entry *res; @@ -661,12 +662,10 @@ extfs_which (struct vfs_class *me, const char *path) /* --------------------------------------------------------------------------------------------- */ /** - * Dissect the path and create corresponding superblock. Note that inname - * can be changed and the result may point inside the original string. + * Dissect the path and create corresponding superblock. */ - -static char * -extfs_get_path_mangle (const vfs_path_t * vpath, struct archive **archive, gboolean do_not_open) +static const char * +extfs_get_path_int (const vfs_path_t * vpath, struct archive **archive, gboolean do_not_open) { char *archive_name; int result = -1; @@ -719,7 +718,7 @@ extfs_get_path_mangle (const vfs_path_t * vpath, struct archive **archive, gbool static char * extfs_get_path (const vfs_path_t * vpath, struct archive **archive, gboolean do_not_open) { - return g_strdup (extfs_get_path_mangle (vpath, archive, do_not_open)); + return g_strdup (extfs_get_path_int (vpath, archive, do_not_open)); } /* --------------------------------------------------------------------------------------------- */ @@ -1112,11 +1111,11 @@ static int extfs_internal_stat (const vfs_path_t * vpath, struct stat *buf, gboolean resolve) { struct archive *archive; - char *q; + const char *q; struct entry *entry; int result = -1; - q = extfs_get_path_mangle (vpath, &archive, FALSE); + q = extfs_get_path_int (vpath, &archive, FALSE); if (q == NULL) goto cleanup; entry = extfs_find_entry (archive->root_entry, q, FALSE, FALSE); @@ -1167,12 +1166,12 @@ static int extfs_readlink (const vfs_path_t * vpath, char *buf, size_t size) { struct archive *archive; - char *q; + const char *q; size_t len; struct entry *entry; int result = -1; - q = extfs_get_path_mangle (vpath, &archive, FALSE); + q = extfs_get_path_int (vpath, &archive, FALSE); if (q == NULL) goto cleanup; entry = extfs_find_entry (archive->root_entry, q, FALSE, FALSE); @@ -1234,11 +1233,11 @@ static int extfs_unlink (const vfs_path_t * vpath) { struct archive *archive; - char *q; + const char *q; struct entry *entry; int result = -1; - q = extfs_get_path_mangle (vpath, &archive, FALSE); + q = extfs_get_path_int (vpath, &archive, FALSE); if (q == NULL) goto cleanup; entry = extfs_find_entry (archive->root_entry, q, FALSE, FALSE); @@ -1272,7 +1271,7 @@ static int extfs_mkdir (const vfs_path_t * vpath, mode_t mode) { struct archive *archive; - char *q; + const char *q; struct entry *entry; int result = -1; const vfs_path_element_t *path_element; @@ -1280,7 +1279,7 @@ extfs_mkdir (const vfs_path_t * vpath, mode_t mode) (void) mode; path_element = vfs_path_get_by_index (vpath, -1); - q = extfs_get_path_mangle (vpath, &archive, FALSE); + q = extfs_get_path_int (vpath, &archive, FALSE); if (q == NULL) goto cleanup; entry = extfs_find_entry (archive->root_entry, q, FALSE, FALSE); @@ -1318,11 +1317,11 @@ static int extfs_rmdir (const vfs_path_t * vpath) { struct archive *archive; - char *q; + const char *q; struct entry *entry; int result = -1; - q = extfs_get_path_mangle (vpath, &archive, FALSE); + q = extfs_get_path_int (vpath, &archive, FALSE); if (q == NULL) goto cleanup; entry = extfs_find_entry (archive->root_entry, q, FALSE, FALSE); -- 2.11.4.GIT