Changeset 76572 in vbox for trunk/src/bldprogs
- Timestamp:
- Jan 1, 2019 4:55:08 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 127874
- Location:
- trunk/src/bldprogs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bldprogs/scm.cpp
r76555 r76572 1091 1091 if (*pValueUnion->psz != '\0') 1092 1092 { 1093 if ( strcmp(pValueUnion->psz, "{dir}") == 0 1094 || strcmp(pValueUnion->psz, "{parent}") == 0) 1095 return RTStrDupEx(&pSettings->pszGuardRelativeToDir, pValueUnion->psz); 1093 1096 if (cchDir == 1 && *pchDir == '/') 1094 1097 { … … 2795 2798 case SCMOPT_GUARD_RELATIVE_TO_DIR: 2796 2799 RTPrintf(" Header guard should be normalized relative to given dir.\n" 2800 " When relative to settings files, no preceeding slash.\n" 2801 " Header relative directory specification: {dir} and {parent}\n" 2797 2802 " If empty no normalization takes place. Default: '%s'\n", g_Defaults.pszGuardRelativeToDir); 2798 2803 break; -
trunk/src/bldprogs/scmrw.cpp
r76556 r76572 2879 2879 return ScmError(pState, rc, "Guard prefix too long (or something): %s\n", pSettings->pszGuardPrefix); 2880 2880 cchNormalized = strlen(szNormalized); 2881 rc = RTPathCalcRelative(&szNormalized[cchNormalized], sizeof(szNormalized) - cchNormalized, 2882 pSettings->pszGuardRelativeToDir, pState->pszFilename); 2881 if (strcmp(pSettings->pszGuardRelativeToDir, "{dir}") == 0) 2882 rc = RTStrCopy(&szNormalized[cchNormalized], sizeof(szNormalized) - cchNormalized, 2883 RTPathFilename(pState->pszFilename)); 2884 else if (strcmp(pSettings->pszGuardRelativeToDir, "{parent}") == 0) 2885 { 2886 const char *pszSrc = RTPathFilename(pState->pszFilename); 2887 if (!pszSrc || (uintptr_t)&pszSrc[-2] < (uintptr_t)pState->pszFilename || !RTPATH_IS_SLASH(pszSrc[-1])) 2888 return ScmError(pState, VERR_INTERNAL_ERROR, "Error calculating {parent} header guard!\n"); 2889 pszSrc -= 2; 2890 while ( (uintptr_t)pszSrc > (uintptr_t)pState->pszFilename 2891 && !RTPATH_IS_SLASH(pszSrc[-1]) 2892 && !RTPATH_IS_VOLSEP(pszSrc[-1])) 2893 pszSrc--; 2894 rc = RTStrCopy(&szNormalized[cchNormalized], sizeof(szNormalized) - cchNormalized, pszSrc); 2895 } 2896 else 2897 rc = RTPathCalcRelative(&szNormalized[cchNormalized], sizeof(szNormalized) - cchNormalized, 2898 pSettings->pszGuardRelativeToDir, pState->pszFilename); 2883 2899 if (RT_FAILURE(rc)) 2884 2900 return ScmError(pState, rc, "Error calculating guard prefix (RTPathCalcRelative): %Rrc\n", rc);
Note:
See TracChangeset
for help on using the changeset viewer.