From adb514a4e0f6d87ff43d1bc0a948c38530a0dc83 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 24 Mar 2019 13:22:28 +0000 Subject: fs/adfs: factor out filename fixup Move the filename fixup to adfs_object_fixup() so we only have one implementation of this. Acked-by: Al Viro Signed-off-by: Russell King --- fs/adfs/dir.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'fs/adfs/dir.c') diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c index 03490f16300d..877d5cffe9e9 100644 --- a/fs/adfs/dir.c +++ b/fs/adfs/dir.c @@ -18,6 +18,19 @@ static DEFINE_RWLOCK(adfs_dir_lock); void adfs_object_fixup(struct adfs_dir *dir, struct object_info *obj) { + unsigned int i; + + /* + * RISC OS allows the use of '/' in directory entry names, so we need + * to fix these up. '/' is typically used for FAT compatibility to + * represent '.', so do the same conversion here. In any case, '.' + * will never be in a RISC OS name since it is used as the pathname + * separator. + */ + for (i = 0; i < obj->name_len; i++) + if (obj->name[i] == '/') + obj->name[i] = '.'; + obj->filetype = -1; /* -- cgit v1.2.3-55-g7522