diff options
| author | John Schmidt <john.schmidt.h@gmail.com> | 2014-03-27 18:53:20 +0100 | 
|---|---|---|
| committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-03-29 13:29:53 -0300 | 
| commit | 44e40b02cf53c95ab248b98df44ec3dd836bb4b5 (patch) | |
| tree | 310e8a4957d70a1ba841e82cdb33d374c75028d6 /src/path.c | |
| parent | f5154d7451c09b39ea6944795c59f86aaad393e0 (diff) | |
| download | rneovim-44e40b02cf53c95ab248b98df44ec3dd836bb4b5.tar.gz rneovim-44e40b02cf53c95ab248b98df44ec3dd836bb4b5.tar.bz2 rneovim-44e40b02cf53c95ab248b98df44ec3dd836bb4b5.zip | |
Move remove_duplicates to garray.c
Diffstat (limited to 'src/path.c')
| -rw-r--r-- | src/path.c | 29 | 
1 files changed, 5 insertions, 24 deletions
| diff --git a/src/path.c b/src/path.c index 2e8865b0c7..f643c8ec82 100644 --- a/src/path.c +++ b/src/path.c @@ -4,17 +4,17 @@  #include "eval.h"  #include "ex_getln.h"  #include "fileio.h" +#include "garray.h"  #include "memline.h"  #include "misc1.h"  #include "misc2.h" -#include "garray.h" -#include "types.h" +#include "os/os.h"  #include "os_unix.h"  #include "regexp.h"  #include "tag.h" +#include "types.h"  #include "ui.h"  #include "window.h" -#include "os/os.h"  /*   * Compare two file names and return: @@ -801,7 +801,7 @@ static void uniquefy_paths(garray_T *gap, char_u *pattern)    char_u      **in_curdir = NULL;    char_u      *short_name; -  remove_duplicates(gap); +  ga_remove_duplicate_strings(gap);    ga_init2(&path_ga, (int)sizeof(char_u *), 1);    /* @@ -930,7 +930,7 @@ theend:    vim_regfree(regmatch.regprog);    if (sort_again) -    remove_duplicates(gap); +    ga_remove_duplicate_strings(gap);  }  /* @@ -993,25 +993,6 @@ expand_in_path (    return gap->ga_len;  } -/* - * Sort "gap" and remove duplicate entries.  "gap" is expected to contain a - * list of file names in allocated memory. - */ -void remove_duplicates(garray_T *gap) -{ -  int i; -  int j; -  char_u  **fnames = (char_u **)gap->ga_data; - -  sort_strings(fnames, gap->ga_len); -  for (i = gap->ga_len - 1; i > 0; --i) -    if (fnamecmp(fnames[i - 1], fnames[i]) == 0) { -      vim_free(fnames[i]); -      for (j = i + 1; j < gap->ga_len; ++j) -        fnames[j - 1] = fnames[j]; -      --gap->ga_len; -    } -}  static int has_env_var(char_u *p); | 
