Mercurial > vim
comparison src/scriptfile.c @ 17978:8f4cc259ed7a v8.1.1985
patch 8.1.1985: code for dealing with paths is spread out
Commit: https://github.com/vim/vim/commit/26262f87770d3a1a68b09a70152d75c2e2ae186f
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 4 20:59:15 2019 +0200
patch 8.1.1985: code for dealing with paths is spread out
Problem: Code for dealing with paths is spread out.
Solution: Move path related functions from misc1.c to filepath.c.
Remove NO_EXPANDPATH.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 04 Sep 2019 21:00:04 +0200 |
parents | 4d63d47d87ef |
children | a6d218f99ff7 |
comparison
equal
deleted
inserted
replaced
17977:7fa0c4b6bfa5 | 17978:8f4cc259ed7a |
---|---|
602 add_pack_plugin, eap->forceit ? &APP_ADD_DIR : &APP_BOTH); | 602 add_pack_plugin, eap->forceit ? &APP_ADD_DIR : &APP_BOTH); |
603 vim_free(pat); | 603 vim_free(pat); |
604 } | 604 } |
605 } | 605 } |
606 #endif | 606 #endif |
607 | |
608 /* | |
609 * Sort "gap" and remove duplicate entries. "gap" is expected to contain a | |
610 * list of file names in allocated memory. | |
611 */ | |
612 void | |
613 remove_duplicates(garray_T *gap) | |
614 { | |
615 int i; | |
616 int j; | |
617 char_u **fnames = (char_u **)gap->ga_data; | |
618 | |
619 sort_strings(fnames, gap->ga_len); | |
620 for (i = gap->ga_len - 1; i > 0; --i) | |
621 if (fnamecmp(fnames[i - 1], fnames[i]) == 0) | |
622 { | |
623 vim_free(fnames[i]); | |
624 for (j = i + 1; j < gap->ga_len; ++j) | |
625 fnames[j - 1] = fnames[j]; | |
626 --gap->ga_len; | |
627 } | |
628 } | |
607 | 629 |
608 /* | 630 /* |
609 * Expand color scheme, compiler or filetype names. | 631 * Expand color scheme, compiler or filetype names. |
610 * Search from 'runtimepath': | 632 * Search from 'runtimepath': |
611 * 'runtimepath'/{dirnames}/{pat}.vim | 633 * 'runtimepath'/{dirnames}/{pat}.vim |