diff options
author | unknown <msvensson@shellback.(none)> | 2006-11-20 21:03:40 +0100 |
---|---|---|
committer | unknown <msvensson@shellback.(none)> | 2006-11-20 21:03:40 +0100 |
commit | bca9a29eac01d29f6e4c04aeee0aac445d37e959 (patch) | |
tree | d0cb6fb096e8c131256fb7702fc02916cea1a1fe /client | |
parent | 6ce5681b12a81807a1f98268d43c6a4d6aa0874e (diff) | |
download | mariadb-git-bca9a29eac01d29f6e4c04aeee0aac445d37e959.tar.gz |
Fix mysqltest to automatically replace \ with / also in
$MYSQLTEST_VARDIR, for usage of vardir=e:/var<nnn> on windows
client/mysqltest.c:
Add auto replace for $MYSQLTEST_VARDIR
Only add strings with strlen > to patterns array - avoids
lot of strlen calls
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index 9ad2f3df5de..ca36abb8f67 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -4138,8 +4138,9 @@ void init_win_path_patterns() /* List of string patterns to match in order to find paths */ const char* paths[] = { "$MYSQL_TEST_DIR", "$MYSQL_TMP_DIR", - "./test/", 0 }; - int num_paths= 3; + "$MYSQLTEST_VARDIR", + "./test/" }; + int num_paths= sizeof(paths)/sizeof(char*), int i; char* p; @@ -4159,6 +4160,13 @@ void init_win_path_patterns() else p= my_strdup(paths[i], MYF(MY_FAE)); + /* Don't insert zero length strings in patterns array */ + if (strlen(p) == 0) + { + my_free(p, MYF(0)); + continue; + } + if (insert_dynamic(&patterns, (gptr) &p)) die(NullS); @@ -4208,7 +4216,7 @@ void fix_win_paths(const char *val, int len) { const char** pattern= dynamic_element(&patterns, i, const char**); DBUG_PRINT("info", ("pattern: %s", *pattern)); - if (strlen(*pattern) == 0) continue; + /* Search for the path in string */ while ((p= strstr(val, *pattern))) { |