- Timestamp:
- Jun 9, 2007 4:56:00 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kObjCache/kObjCache.c
r1045 r1046 1152 1152 */ 1153 1153 if ( !fgets(g_szLine, sizeof(g_szLine), pFile) 1154 || strcmp(g_szLine, "magic=kObjCache -1\n"))1154 || strcmp(g_szLine, "magic=kObjCacheEntry-v0.1.0\n")) 1155 1155 { 1156 1156 InfoMsg(2, "bad cache file (magic)\n"); … … 1344 1344 do { int cch = expr; if (cch >= KOBJCACHE_MAX_LINE_LEN) FatalDie("Line too long: %d (max %d)\nexpr: %s\n", cch, KOBJCACHE_MAX_LINE_LEN, #expr); } while (0) 1345 1345 1346 fprintf(pFile, "magic=kObjCache -1\n");1346 fprintf(pFile, "magic=kObjCacheEntry-v0.1.0\n"); 1347 1347 CHECK_LEN(fprintf(pFile, "target=%s\n", pEntry->New.pszTarget ? pEntry->New.pszTarget : pEntry->Old.pszTarget)); 1348 1348 CHECK_LEN(fprintf(pFile, "key=%u\n", (unsigned long)pEntry->uKey)); … … 3655 3655 enum { kOC_Options, kOC_CppArgv, kOC_CcArgv, kOC_BothArgv } enmMode = kOC_Options; 3656 3656 3657 size_t cch; 3657 3658 char *psz; 3658 3659 int i; … … 3777 3778 /* 3778 3779 * Calc the cache file name. 3780 * It's a bit messy since the extension has to be replaced. 3779 3781 */ 3780 3782 if (!pszCacheFile) … … 3784 3786 if (!pszCacheName) 3785 3787 { 3786 psz CacheName =FindFilenameInPath(pszEntryFile);3787 if (!*psz CacheName)3788 psz = (char *)FindFilenameInPath(pszEntryFile); 3789 if (!*psz) 3788 3790 return SyntaxError("The cache file (-f) specifies a directory / nothing!\n"); 3789 pszCacheName = xstrdup(pszCacheName); 3791 cch = psz - pszEntryFile; 3792 pszCacheName = memcpy(xmalloc(cch + 5), psz, cch + 1); 3790 3793 psz = strrchr(pszCacheName, '.'); 3791 if (psz > pszCacheName) 3792 *psz = '\0'; 3794 if (!psz || psz <= pszCacheName) 3795 psz = (char *)pszCacheName + cch; 3796 memcpy(psz, ".koc", sizeof(".koc") - 1); 3793 3797 } 3794 3798 pszCacheFile = MakePathFromDirAndFile(pszCacheName, pszCacheDir); … … 3796 3800 3797 3801 /* 3798 * Create and initialize the two bojects we'll be working on.3802 * Create and initialize the two objects we'll be working on. 3799 3803 * 3800 3804 * We're supposed to be the only ones actually writing to the local file,
Note:
See TracChangeset
for help on using the changeset viewer.