summaryrefslogtreecommitdiff
path: root/mysys/mf_loadpath.c
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-07-01 17:59:42 +0300
committerunknown <monty@mashka.mysql.fi>2003-07-01 17:59:42 +0300
commit2224bbc16abd201828f3c7edfd426198507e7da3 (patch)
tree98266972b4b90cacc8f2dae9b1038b3ee8f350f4 /mysys/mf_loadpath.c
parentc672b5d04b4828a194df6e1a99c8454b07dc2400 (diff)
downloadmariadb-git-2224bbc16abd201828f3c7edfd426198507e7da3.tar.gz
Fixed testcases and bug introduced by last changeset
mysql-test/r/func_gconcat.result: Fixed test case after merge mysql-test/r/grant_cache.result: Updated test case (Wrong push by some developer) mysys/mf_loadpath.c: Fix for my_load_path() and ./directory handling from last changeset
Diffstat (limited to 'mysys/mf_loadpath.c')
-rw-r--r--mysys/mf_loadpath.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mysys/mf_loadpath.c b/mysys/mf_loadpath.c
index 2c90d9f90a6..a46b43c34d4 100644
--- a/mysys/mf_loadpath.c
+++ b/mysys/mf_loadpath.c
@@ -28,6 +28,7 @@ my_string my_load_path(my_string to, const char *path,
const char *own_path_prefix)
{
char buff[FN_REFLEN];
+ int is_cur;
DBUG_ENTER("my_load_path");
DBUG_PRINT("enter",("path: %s prefix: %s",path,
own_path_prefix ? own_path_prefix : ""));
@@ -35,12 +36,14 @@ my_string my_load_path(my_string to, const char *path,
if ((path[0] == FN_HOMELIB && path[1] == FN_LIBCHAR) ||
test_if_hard_path(path))
VOID(strmov(buff,path));
- else if ((path[0] == FN_CURLIB && path[1] == FN_LIBCHAR) ||
+ else if ((is_cur=(path[0] == FN_CURLIB && path[1] == FN_LIBCHAR)) ||
(is_prefix((gptr) path,FN_PARENTDIR)) ||
! own_path_prefix)
{
- if (! my_getwd(buff,(uint) (FN_REFLEN+2-strlen(path)),MYF(0)))
- VOID(strcat(buff,path+2));
+ if (is_cur)
+ is_cur=2; /* Remove current dir */
+ if (! my_getwd(buff,(uint) (FN_REFLEN-strlen(path)+is_cur),MYF(0)))
+ VOID(strcat(buff,path+is_cur));
else
VOID(strmov(buff,path)); /* Return org file name */
}