Mercurial > vim
comparison src/misc2.c @ 461:f98374445f66
updated for version 7.0123
author | vimboss |
---|---|
date | Thu, 04 Aug 2005 21:29:45 +0000 |
parents | d9d38102399f |
children | a5fcf36ef512 |
comparison
equal
deleted
inserted
replaced
460:7f2d3b3c15a2 | 461:f98374445f66 |
---|---|
4056 /* restrict is 0 -> remove already added '**' */ | 4056 /* restrict is 0 -> remove already added '**' */ |
4057 len -= 2; | 4057 len -= 2; |
4058 else | 4058 else |
4059 ff_expand_buffer[len++] = FF_MAX_STAR_STAR_EXPAND; | 4059 ff_expand_buffer[len++] = FF_MAX_STAR_STAR_EXPAND; |
4060 wc_part = (char_u *)errpt; | 4060 wc_part = (char_u *)errpt; |
4061 if (*wc_part != PATHSEP && *wc_part != NUL) | 4061 if (*wc_part != NUL && !vim_ispathsep(*wc_part)) |
4062 { | 4062 { |
4063 EMSG2(_("E343: Invalid path: '**[number]' must be at the end of the path or be followed by '%s'."), PATHSEPSTR); | 4063 EMSG2(_("E343: Invalid path: '**[number]' must be at the end of the path or be followed by '%s'."), PATHSEPSTR); |
4064 goto error_return; | 4064 goto error_return; |
4065 } | 4065 } |
4066 } | 4066 } |
4580 ff_search_ctx->ffsc_stopdirs_v) == TRUE) | 4580 ff_search_ctx->ffsc_stopdirs_v) == TRUE) |
4581 break; | 4581 break; |
4582 | 4582 |
4583 /* cut of last dir */ | 4583 /* cut of last dir */ |
4584 while (path_end > ff_search_ctx->ffsc_start_dir | 4584 while (path_end > ff_search_ctx->ffsc_start_dir |
4585 && *path_end == PATHSEP) | 4585 && vim_ispathsep(*path_end)) |
4586 path_end--; | 4586 path_end--; |
4587 while (path_end > ff_search_ctx->ffsc_start_dir | 4587 while (path_end > ff_search_ctx->ffsc_start_dir |
4588 && *(path_end-1) != PATHSEP) | 4588 && !vim_ispathsep(path_end[-1])) |
4589 path_end--; | 4589 path_end--; |
4590 *path_end = 0; | 4590 *path_end = 0; |
4591 path_end--; | 4591 path_end--; |
4592 | 4592 |
4593 if (*ff_search_ctx->ffsc_start_dir == 0) | 4593 if (*ff_search_ctx->ffsc_start_dir == 0) |
5048 char_u **stopdirs_v; | 5048 char_u **stopdirs_v; |
5049 { | 5049 { |
5050 int i = 0; | 5050 int i = 0; |
5051 | 5051 |
5052 /* eat up trailing path separators, except the first */ | 5052 /* eat up trailing path separators, except the first */ |
5053 while (path_len > 1 && path[path_len - 1] == PATHSEP) | 5053 while (path_len > 1 && vim_ispathsep(path[path_len - 1])) |
5054 path_len--; | 5054 path_len--; |
5055 | 5055 |
5056 /* if no path consider it as match */ | 5056 /* if no path consider it as match */ |
5057 if (path_len == 0) | 5057 if (path_len == 0) |
5058 return TRUE; | 5058 return TRUE; |
5064 /* match for parent directory. So '/home' also matches | 5064 /* match for parent directory. So '/home' also matches |
5065 * '/home/rks'. Check for PATHSEP in stopdirs_v[i], else | 5065 * '/home/rks'. Check for PATHSEP in stopdirs_v[i], else |
5066 * '/home/r' would also match '/home/rks' | 5066 * '/home/r' would also match '/home/rks' |
5067 */ | 5067 */ |
5068 if (fnamencmp(stopdirs_v[i], path, path_len) == 0 | 5068 if (fnamencmp(stopdirs_v[i], path, path_len) == 0 |
5069 && stopdirs_v[i][path_len] == PATHSEP) | 5069 && vim_ispathsep(stopdirs_v[i][path_len])) |
5070 return TRUE; | 5070 return TRUE; |
5071 } | 5071 } |
5072 else | 5072 else |
5073 { | 5073 { |
5074 if (fnamecmp(stopdirs_v[i], path) == 0) | 5074 if (fnamecmp(stopdirs_v[i], path) == 0) |