summaryrefslogtreecommitdiff
path: root/mysys/mf_dirname.c
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-10-08 23:20:19 +0300
committermonty@hundin.mysql.fi <>2001-10-08 23:20:19 +0300
commit196f620e9024b12e33125c4be03c867b0fabbfcc (patch)
treee7d13849a1d92edeaacd31753856f5a8cb389781 /mysys/mf_dirname.c
parent46a660f450cfb78785838f4dc923eaf6b75c5961 (diff)
downloadmariadb-git-196f620e9024b12e33125c4be03c867b0fabbfcc.tar.gz
Portability fixes + a couple of bug fixes introduced by last push.
Diffstat (limited to 'mysys/mf_dirname.c')
-rw-r--r--mysys/mf_dirname.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mysys/mf_dirname.c b/mysys/mf_dirname.c
index fb5d77d8ab8..a9d91963480 100644
--- a/mysys/mf_dirname.c
+++ b/mysys/mf_dirname.c
@@ -83,7 +83,7 @@ char *convert_dirname(char *to, const char *from, const char *from_end)
#if FN_LIBCHAR != '/' || defined(FN_C_BEFORE_DIR_2)
{
- while (*from && *from != end)
+ for (; *from && from != from_end; from++)
{
if (*from == '/')
*to++= FN_LIBCHAR;
@@ -94,8 +94,9 @@ char *convert_dirname(char *to, const char *from, const char *from_end)
*to++= FN_C_AFTER_DIR;
#endif
else
- *to++= *from++;
+ *to++= *from;
}
+ *to=0;
}
#else
/* This is ok even if to == from, becasue we need to cut the string */