comparison src/os_unix.c @ 39:410fa1a31baf v7.0023

updated for version 7.0023
author vimboss
date Sun, 19 Dec 2004 22:46:22 +0000
parents fdf55076c53f
children c75153d791d0
comparison
equal deleted inserted replaced
38:c524f99c7925 39:410fa1a31baf
2187 { 2187 {
2188 while (*p) 2188 while (*p)
2189 { 2189 {
2190 if (*p == psepcN) 2190 if (*p == psepcN)
2191 *p = psepc; 2191 *p = psepc;
2192 #ifdef FEAT_MBYTE 2192 mb_ptr_adv(p);
2193 if (has_mbyte)
2194 p += (*mb_ptr2len_check)(p);
2195 else
2196 #endif
2197 ++p;
2198 } 2193 }
2199 } 2194 }
2200 #endif 2195 #endif
2201 2196
2202 /* 2197 /*
4511 #ifndef NO_EXPANDPATH 4506 #ifndef NO_EXPANDPATH
4512 static int 4507 static int
4513 pstrcmp(a, b) 4508 pstrcmp(a, b)
4514 const void *a, *b; 4509 const void *a, *b;
4515 { 4510 {
4516 return (pathcmp(*(char **)a, *(char **)b)); 4511 return (pathcmp(*(char **)a, *(char **)b, -1));
4517 } 4512 }
4518 4513
4519 /* 4514 /*
4520 * Recursively expand one path component into all matching files and/or 4515 * Recursively expand one path component into all matching files and/or
4521 * directories. 4516 * directories.
4792 * there. */ 4787 * there. */
4793 len = STRLEN(p); 4788 len = STRLEN(p);
4794 if (((*file)[*num_file] = alloc(len + 2)) != NULL) 4789 if (((*file)[*num_file] = alloc(len + 2)) != NULL)
4795 { 4790 {
4796 STRCPY((*file)[*num_file], p); 4791 STRCPY((*file)[*num_file], p);
4797 if (!vim_ispathsep((*file)[*num_file][len - 1])) 4792 if (!after_pathsep((*file)[*num_file] + len))
4798 { 4793 {
4799 (*file)[*num_file][len] = psepc; 4794 (*file)[*num_file][len] = psepc;
4800 (*file)[*num_file][len + 1] = 0; 4795 (*file)[*num_file][len + 1] = NUL;
4801 } 4796 }
4802 } 4797 }
4803 } 4798 }
4804 else 4799 else
4805 { 4800 {
5257 */ 5252 */
5258 int 5253 int
5259 mch_has_exp_wildcard(p) 5254 mch_has_exp_wildcard(p)
5260 char_u *p; 5255 char_u *p;
5261 { 5256 {
5262 for ( ; *p; ++p) 5257 for ( ; *p; mb_ptr_adv(p))
5263 { 5258 {
5264 #ifndef OS2 5259 #ifndef OS2
5265 if (*p == '\\' && p[1] != NUL) 5260 if (*p == '\\' && p[1] != NUL)
5266 ++p; 5261 ++p;
5267 else 5262 else
5276 "*?[{'" 5271 "*?[{'"
5277 # endif 5272 # endif
5278 #endif 5273 #endif
5279 , *p) != NULL) 5274 , *p) != NULL)
5280 return TRUE; 5275 return TRUE;
5281 #ifdef FEAT_MBYTE
5282 if (has_mbyte)
5283 p += (*mb_ptr2len_check)(p) - 1;
5284 #endif
5285 } 5276 }
5286 return FALSE; 5277 return FALSE;
5287 } 5278 }
5288 5279
5289 /* 5280 /*
5292 */ 5283 */
5293 int 5284 int
5294 mch_has_wildcard(p) 5285 mch_has_wildcard(p)
5295 char_u *p; 5286 char_u *p;
5296 { 5287 {
5297 for ( ; *p; ++p) 5288 for ( ; *p; mb_ptr_adv(p))
5298 { 5289 {
5299 #ifndef OS2 5290 #ifndef OS2
5300 if (*p == '\\' && p[1] != NUL) 5291 if (*p == '\\' && p[1] != NUL)
5301 ++p; 5292 ++p;
5302 else 5293 else
5316 # endif 5307 # endif
5317 #endif 5308 #endif
5318 , *p) != NULL 5309 , *p) != NULL
5319 || (*p == '~' && p[1] != NUL)) 5310 || (*p == '~' && p[1] != NUL))
5320 return TRUE; 5311 return TRUE;
5321 #ifdef FEAT_MBYTE
5322 if (has_mbyte)
5323 p += (*mb_ptr2len_check)(p) - 1;
5324 #endif
5325 } 5312 }
5326 return FALSE; 5313 return FALSE;
5327 } 5314 }
5328 5315
5329 #ifndef __EMX__ 5316 #ifndef __EMX__