Changeset 3169 for trunk/tools
- Timestamp:
- Mar 19, 2000, 5:23:55 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/fastdep/fastdep.c
r3162 r3169 1 /* $Id: fastdep.c,v 1.1 5 2000-03-18 23:56:24bird Exp $1 /* $Id: fastdep.c,v 1.16 2000-03-19 16:23:55 bird Exp $ 2 2 * 3 3 * Fast dependents. (Fast = Quick and Dirty!) … … 230 230 231 231 /* 232 * Environment variables used. 233 * (These has the correct case.) 234 */ 235 static char * pszIncludeEnv; 236 237 238 /* 232 239 * Configuration stuff. 233 240 */ … … 292 299 int argi = 1; 293 300 int i; 301 char * psz; 294 302 const char *pszDepFile = pszDefaultDepFile; 295 303 char achBuffer[4096]; … … 349 357 szCurDir[i] = '\0'; 350 358 } 359 360 361 /* 362 * Initiate environment variables used: INCLUDE 363 */ 364 psz = getenv("INCLUDE"); 365 if (psz != NULL) 366 { 367 pszIncludeEnv = strdup(psz); 368 strlwr(pszIncludeEnv); 369 } 370 else 371 pszIncludeEnv = ""; 372 351 373 352 374 /* … … 416 438 argi++; 417 439 } 440 strlwr(szExclude); 418 441 if (szExclude[strlen(szExclude)-1] != ';') 419 442 strcat(szExclude, ";"); … … 429 452 argi++; 430 453 } 454 strlwr(szInclude); 431 455 if (szInclude[strlen(szInclude)-1] != ';') 432 456 strcat(szInclude, ";"); … … 608 632 szSource[0] = '\0'; 609 633 strcat(szSource, pfindbuf3->achName); 634 strlwr(szSource); 610 635 611 636 /* … … 687 712 * and written to file later. 688 713 * @returns 689 * @param pszFilename Pointer to source filename. 714 * @param pszFilename Pointer to source filename. Correct case is assumed! 690 715 * @param pOptions Pointer to options struct. 691 716 * @status completely implemented. … … 745 770 * @returns 0 on success. 746 771 * !0 on error. 747 * @param pszFilename Pointer to source filename. 772 * @param pszFilename Pointer to source filename. Correct case is assumed! 748 773 * @param pvFile Pointer to file textbuffer. 749 774 * @param pOptions Pointer to options struct. … … 885 910 strncpy(szFullname, &szBuffer[i], j); 886 911 szFullname[j] = '\0'; /* ensure terminatition. */ 912 strlwr(szFullname); 887 913 888 914 /* find include file! */ 889 915 psz = pathlistFindFile(pOptions->pszInclude, szFullname, szBuffer, pOptions); 890 916 if (psz == NULL) 891 psz = pathlistFindFile( getenv("INCLUDE"), szFullname, szBuffer, pOptions);917 psz = pathlistFindFile(pszIncludeEnv, szFullname, szBuffer, pOptions); 892 918 893 919 /* did we find the include? */ … … 1024 1050 * @returns 0 on success. 1025 1051 * !0 on error. 1026 * @param pszFilename Pointer to source filename. 1052 * @param pszFilename Pointer to source filename. Correct case is assumed! 1027 1053 * @param pvFile Pointer to file textbuffer. 1028 1054 * @param pOptions Pointer to options struct. … … 1110 1136 strncpy(szFullname, &szBuffer[i], j); 1111 1137 szFullname[j] = '\0'; /* ensure terminatition. */ 1138 strlwr(szFullname); 1112 1139 1113 1140 /* find include file! */ 1114 1141 psz = pathlistFindFile(pOptions->pszInclude, szFullname, szBuffer, pOptions); 1115 1142 if (psz == NULL) 1116 psz = pathlistFindFile( getenv("INCLUDE"), szFullname, szBuffer, pOptions);1143 psz = pathlistFindFile(pszIncludeEnv, szFullname, szBuffer, pOptions); 1117 1144 1118 1145 /* Did we find the include? */ … … 1142 1169 * @returns 0 on success. 1143 1170 * !0 on error. 1144 * @param pszFilename Pointer to source filename. 1171 * @param pszFilename Pointer to source filename. Correct case is assumed! 1145 1172 * @param pvFile Pointer to file textbuffer. 1146 1173 * @param pOptions Pointer to options struct. … … 1230 1257 strncpy(szFullname, &szBuffer[i], j); 1231 1258 szFullname[j] = '\0'; /* ensure terminatition. */ 1259 strlwr(szFullname); 1232 1260 1233 1261 /* find include file! */ 1234 1262 psz = pathlistFindFile(pOptions->pszInclude, szFullname, szBuffer, pOptions); 1235 1263 if (psz == NULL) 1236 psz = pathlistFindFile( getenv("INCLUDE"), szFullname, szBuffer, pOptions);1264 psz = pathlistFindFile(pszIncludeEnv, szFullname, szBuffer, pOptions); 1237 1265 1238 1266 /* did we find the include? */ … … 1262 1290 * @returns 0 on success. 1263 1291 * !0 on error. 1264 * @param pszFilename Pointer to source filename. 1292 * @param pszFilename Pointer to source filename. Correct case is assumed! 1265 1293 * @param pvFile Pointer to file textbuffer. 1266 1294 * @param pOptions Pointer to options struct. … … 1379 1407 strncpy(szFullname, &szBuffer[i], j); 1380 1408 szFullname[j] = '\0'; /* ensure terminatition. */ 1409 strlwr(szFullname); 1381 1410 1382 1411 /* add extention .cpy - hardcoded for the moment. */ … … 1543 1572 1544 1573 /* lower case it */ 1545 strlwr(psz);1574 /*strlwr(psz);*/ 1546 1575 1547 1576 return psz; … … 1762 1791 /* Make path */ 1763 1792 filePathSlash2(pszDir, szDir); 1764 strlwr(szDir); /* Convert name to lower case to allow faster searchs! */1793 //strlwr(szDir); /* Convert name to lower case to allow faster searchs! */ 1765 1794 cchDir = strlen(szDir); 1766 1795 … … 1885 1914 strcpy(&pszBuffer[pszNext - psz], "\\"); 1886 1915 strcat(pszBuffer, pszFilename); 1887 strlwr(pszBuffer); /* to speed up AVL tree search we'll lowercase all names. */1916 //strlwr(pszBuffer); /* to speed up AVL tree search we'll lowercase all names. */ 1888 1917 fileNormalize(pszBuffer); 1889 1918 … … 2058 2087 FILE *phFile; 2059 2088 2060 phFile = fopen(pszFilename, "r ");2089 phFile = fopen(pszFilename, "rb"); 2061 2090 if (phFile != NULL) 2062 2091 { … … 2114 2143 2115 2144 /* skip line end */ 2145 if (ch == '\r') 2146 ch = *++psz; 2116 2147 if (ch == '\n') 2117 psz++;2118 if (*psz == '\r')2119 2148 psz++; 2120 2149 … … 2155 2184 2156 2185 /* skip line end */ 2186 if (ch == '\r') 2187 ch = *++psz; 2157 2188 if (ch == '\n') 2158 ch = *++psz;2159 if (ch == '\r')2160 2189 psz++; 2161 2190
Note:
See TracChangeset
for help on using the changeset viewer.