comparison src/os_unix.c @ 99:04f2e519ab18

updated for version 7.0038
author vimboss
date Fri, 14 Jan 2005 21:48:43 +0000
parents 587305d23d2c
children 9e65557da34c
comparison
equal deleted inserted replaced
98:98435a8ddb09 99:04f2e519ab18
4722 /* expand environment var or home dir */ 4722 /* expand environment var or home dir */
4723 buf = expand_env_save(*pat); 4723 buf = expand_env_save(*pat);
4724 else 4724 else
4725 buf = vim_strsave(*pat); 4725 buf = vim_strsave(*pat);
4726 expl_files = NULL; 4726 expl_files = NULL;
4727 has_wildcard = mch_has_exp_wildcard(buf); /* (still) wildcards in there? */ 4727 has_wildcard = mch_has_exp_wildcard(buf); /* (still) wildcards? */
4728 if (has_wildcard) /* yes, so expand them */ 4728 if (has_wildcard) /* yes, so expand them */
4729 expl_files = (char_u **)_fnexplode(buf); 4729 expl_files = (char_u **)_fnexplode(buf);
4730 4730
4731 /* 4731 /*
4732 * return value of buf if no wildcards left, 4732 * return value of buf if no wildcards left,
5224 char_u **pat; 5224 char_u **pat;
5225 int *num_file; 5225 int *num_file;
5226 char_u ***file; 5226 char_u ***file;
5227 { 5227 {
5228 int i; 5228 int i;
5229 char_u *s;
5229 5230
5230 *file = (char_u **)alloc(num_pat * sizeof(char_u *)); 5231 *file = (char_u **)alloc(num_pat * sizeof(char_u *));
5231 if (*file == NULL) 5232 if (*file == NULL)
5232 return FAIL; 5233 return FAIL;
5233 for (i = 0; i < num_pat; i++) 5234 for (i = 0; i < num_pat; i++)
5234 (*file)[i] = vim_strsave(pat[i]); 5235 {
5236 s = vim_strsave(pat[i]);
5237 if (s != NULL)
5238 /* Be compatible with expand_filename(): halve the number of
5239 * backslashes. */
5240 backslash_halve(s);
5241 (*file)[i] = s;
5242 }
5235 *num_file = num_pat; 5243 *num_file = num_pat;
5236 return OK; 5244 return OK;
5237 } 5245 }
5238 #endif 5246 #endif
5239 5247