Mercurial > vim
diff src/ex_getln.c @ 480:bf5ba8a0cdee v7.0129
updated for version 7.0129
author | vimboss |
---|---|
date | Fri, 12 Aug 2005 19:59:19 +0000 |
parents | a5fcf36ef512 |
children | 66080ac5dab7 |
line wrap: on
line diff
--- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -4151,14 +4151,14 @@ ExpandGeneric(xp, regmatch, num_file, fi { int i; int count = 0; - int loop; + int round; char_u *str; /* do this loop twice: - * loop == 0: count the number of matching names - * loop == 1: copy the matching names into allocated memory + * round == 0: count the number of matching names + * round == 1: copy the matching names into allocated memory */ - for (loop = 0; loop <= 1; ++loop) + for (round = 0; round <= 1; ++round) { for (i = 0; ; ++i) { @@ -4170,7 +4170,7 @@ ExpandGeneric(xp, regmatch, num_file, fi if (vim_regexec(regmatch, str, (colnr_T)0)) { - if (loop) + if (round) { str = vim_strsave_escaped(str, (char_u *)" \t\\."); (*file)[count] = str; @@ -4187,7 +4187,7 @@ ExpandGeneric(xp, regmatch, num_file, fi ++count; } } - if (loop == 0) + if (round == 0) { if (count == 0) return OK; @@ -4201,6 +4201,10 @@ ExpandGeneric(xp, regmatch, num_file, fi count = 0; } } + + /* Sort the results. */ + sort_strings(*file, *num_file); + return OK; }