summaryrefslogtreecommitdiff
path: root/mysys/my_access.c
diff options
context:
space:
mode:
authorreggie@mdk10.(none) <>2005-06-22 18:51:48 -0500
committerreggie@mdk10.(none) <>2005-06-22 18:51:48 -0500
commit98ddf74dd3e9acf653af42b3f130b5f226b6b748 (patch)
tree02696d472a9ccb27d903d20347b80836dc2c6147 /mysys/my_access.c
parent4ddc13af42ed2854e172ba3b9e23aa567393ecab (diff)
parent705992719a602c5dad9339be70f7be5ed00e3d6f (diff)
downloadmariadb-git-98ddf74dd3e9acf653af42b3f130b5f226b6b748.tar.gz
Merge mdk10.(none):/home/reggie/bk/bug9148
into mdk10.(none):/home/reggie/bk/mysql-5.0-base
Diffstat (limited to 'mysys/my_access.c')
-rw-r--r--mysys/my_access.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/mysys/my_access.c b/mysys/my_access.c
index 28210bdfc7d..c01031827c0 100644
--- a/mysys/my_access.c
+++ b/mysys/my_access.c
@@ -93,18 +93,20 @@ int check_if_legal_filename(const char *path)
path+= dirname_length(path); /* To start of filename */
if (!(end= strchr(path, FN_EXTCHAR)))
end= strend(path);
- if (path == end || (uint) (path - end) > MAX_RESERVED_NAME_LENGTH)
+ if (path == end || (uint) (end - path) > MAX_RESERVED_NAME_LENGTH)
DBUG_RETURN(0); /* Simplify inner loop */
for (reserved_name= reserved_names; *reserved_name; reserved_name++)
{
const char *name= path;
- while (name != end)
+ const char *current_reserved_name= *reserved_name;
+
+ while (name != end && *current_reserved_name)
{
- if (my_toupper(&my_charset_latin1, *path) !=
- my_toupper(&my_charset_latin1, *name))
+ if (*current_reserved_name != my_toupper(&my_charset_latin1, *name))
break;
- if (name++ == end)
+ current_reserved_name++;
+ if (++name == end)
DBUG_RETURN(1); /* Found wrong path */
}
}