diff options
author | unknown <petr@mysql.com> | 2005-04-14 01:57:52 +0400 |
---|---|---|
committer | unknown <petr@mysql.com> | 2005-04-14 01:57:52 +0400 |
commit | 8487a67bf3191c23b7d1cfb4fcadd1c57b95435b (patch) | |
tree | fd215d7dd585dcb93aecf7a1dba27a073f832b72 /mysys/default.c | |
parent | 11b666fb49b681f33176542aedb8f3ba229c4d15 (diff) | |
parent | 82231c24c482f740452091b68751341b19060135 (diff) | |
download | mariadb-git-8487a67bf3191c23b7d1cfb4fcadd1c57b95435b.tar.gz |
Merge mysql.com:/home/cps/mysql/trees/mysql-4.1
into mysql.com:/home/cps/mysql/trees/mysql-5.0
mysys/default.c:
Auto merged
sql/ha_innodb.cc:
Auto merged
Diffstat (limited to 'mysys/default.c')
-rw-r--r-- | mysys/default.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/mysys/default.c b/mysys/default.c index 6352cc18d56..0f33c94d17e 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -513,15 +513,16 @@ static int search_default_file_with_ext(Process_option_func opt_handler, /* trim trailing whitespace from directory name */ end= ptr + strlen(ptr) - 1; - /* - This would work fine even if no whitespaces are met - since fgets() stores the newline character in the buffer - */ - for (; my_isspace(&my_charset_latin1, *(end - 1)); end--) - {} - end[0]= 0; + /* fgets() stores the newline character in the buffer */ + if ((end[0] == '\n') || (end[0] == '\r') || + my_isspace(&my_charset_latin1, end[0])) + { + for (; my_isspace(&my_charset_latin1, *(end - 1)); end--) + {} + end[0]= 0; + } - /* print error msg if there is nothing after !inludedir directive */ + /* print error msg if there is nothing after !includedir directive */ if (end == ptr) { fprintf(stderr, @@ -539,7 +540,7 @@ static int search_default_file_with_ext(Process_option_func opt_handler, search_file= search_dir->dir_entry + i; ext= fn_ext(search_file->name); - /* check extenstion */ + /* check extension */ for (tmp_ext= (char**) f_extensions; *tmp_ext; *tmp_ext++) { if (!strcmp(ext, *tmp_ext)) @@ -587,6 +588,14 @@ static int search_default_file_with_ext(Process_option_func opt_handler, continue; } + else + if (recursion_level >= max_recursion_level) + { + fprintf(stderr, + "warning: skipping !include directive as maximum include" + "recursion level was reached in file %s at line %d\n", + name, line); + } if (*ptr == '[') /* Group name */ { |