summaryrefslogtreecommitdiff
path: root/mysys/mf_dirname.c
diff options
context:
space:
mode:
authormonty@tramp.mysql.fi <>2000-10-03 14:18:03 +0300
committermonty@tramp.mysql.fi <>2000-10-03 14:18:03 +0300
commit9f7c4563f78f74999efd94768ec483d8c24c3761 (patch)
treec02cc6a9c6585038615c596332aae70354b44aac /mysys/mf_dirname.c
parent69a249c054b3c1dd4c1aadeb735291ea63862c98 (diff)
downloadmariadb-git-9f7c4563f78f74999efd94768ec483d8c24c3761.tar.gz
First part of automatic repair of MyISAM tables.
Error on full disk on repair. SIGHUP signal handling. Update with keys on timestamp Portability fixes
Diffstat (limited to 'mysys/mf_dirname.c')
-rw-r--r--mysys/mf_dirname.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mysys/mf_dirname.c b/mysys/mf_dirname.c
index 1bd6d256cfe..f4b9e011215 100644
--- a/mysys/mf_dirname.c
+++ b/mysys/mf_dirname.c
@@ -66,8 +66,9 @@ uint dirname_part(my_string to, const char *name)
#define FN_DEVCHAR '\0' /* For easier code */
#endif
-void convert_dirname(my_string to)
+char *convert_dirname(my_string to)
{
+ reg1 char *pos;
#ifdef FN_UPPER_CASE
caseup_str(to);
#endif
@@ -76,7 +77,6 @@ void convert_dirname(my_string to)
#endif
#if FN_LIBCHAR != '/'
{
- reg1 my_string pos;
pos=to-1; /* Change from '/' */
while ((pos=strchr(pos+1,'/')) != 0)
*pos=FN_LIBCHAR;
@@ -84,7 +84,6 @@ void convert_dirname(my_string to)
#endif
#ifdef FN_C_BEFORE_DIR_2
{
- reg1 my_string pos;
for (pos=to ; *pos ; pos++)
{
if (*pos == FN_C_BEFORE_DIR_2)
@@ -95,12 +94,13 @@ void convert_dirname(my_string to)
}
#else
{ /* Append FN_LIBCHAR if not there */
- char *end=strend(to);
- if (end != to && (end[-1] != FN_LIBCHAR && end[-1] != FN_DEVCHAR))
+ pos=strend(to);
+ if (pos != to && (pos[-1] != FN_LIBCHAR && pos[-1] != FN_DEVCHAR))
{
- end[0]=FN_LIBCHAR;
- end[1]=0;
+ *pos++=FN_LIBCHAR;
+ *pos=0;
}
}
#endif
+ return pos; /* Pointer to end of dir */
} /* convert_dirname */