<--------------____________
函数返回到fnmatch_nocase() /* /src/utils.c*/
刚才的alloca函数带回了可以分配的资源。貌似军队上的补记来了!敬礼!*/[code]
856 char *patcopy = (char *) alloca (strlen (pattern) + 1);
857 char *strcopy = (char *) alloca (strlen (string) + 1);
858 char *p;
859 for (p = patcopy; *pattern; pattern++, p++)
860 *p = c_tolower (*pattern); /*_____------>/lib/c-ctype.c 转化为小写字母 /
861 *p = '\0';
862 for (p = strcopy; *string; string++, p++)
863 *p = c_tolower (*string);
864 *p = '\0';
865 return fnmatch (patcopy, strcopy, flags); /*fnmatch函数进行字符通配,比如匹配*、?等字符fnmatch.c*/
866 #endif
867 }
[/code]_____________------------>[code]
323 c_tolower (int c)
324 {
325 #if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
326 return (c >= 'A' && c <= 'Z' ? c - 'A' + 'a' : c); /*另一中转化方式,如果是大写,那么转化成小写,小写不变*/
327 #else
328 switch (c)
329 {
330 case 'A': return 'a';
331 case 'B': return 'b';
332 case 'C': return 'c';
333 case 'D': return 'd';
334 case 'E': return 'e';
335 case 'F': return 'f';
336 case 'G': return 'g';
337 case 'H': return 'h';
338 case 'I': return 'i';
339 case 'J': return 'j';
340 case 'K': return 'k';
341 case 'L': return 'l';
342 case 'M': return 'm';
343 case 'N': return 'n';
344 case 'O': return 'o';
345 case 'P': return 'p';
346 case 'Q': return 'q';
347 case 'R': return 'r';
348 case 'S': return 's';
349 case 'T': return 't';
350 case 'U': return 'u';
351 case 'V': return 'v';
352 case 'W': return 'w';
353 case 'X': return 'x';
354 case 'Y': return 'y';
355 case 'Z': return 'z';
357 }
358 #endif
359 }
[/code]<----------_______________
这里彻底返回到 test_dir_matches_p()函数
test_dir_matches_p()
{
2417 bool res = dir_matches_p (test_array[i].dirlist, test_array[i].dir);
2418
2419 mu_assert ("test_dir_matches_p: wrong result",
2420 res == test_array[i].result);
2421 }
2422
2423 return NULL;
2424 }
/*测试完毕*/
________________________________END ____________________________________IN__TEST_DIR__MATCHES_P____________________________
阅读(783) | 评论(0) | 转发(0) |