Changeset 26347 in vbox
- Timestamp:
- Feb 9, 2010 4:26:18 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/src/bldprogs/scm.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bldprogs/scm.cpp
r26345 r26347 274 274 static PFNSCMREWRITER const g_aRewritersFor_BatchFiles[] = 275 275 { 276 rewrite_Force LF,276 rewrite_ForceCRLF, 277 277 rewrite_ExpandTabs, 278 278 rewrite_StripTrailingBlanks … … 1172 1172 RTStrmPutCh(pState->pDiff, chPrefix); 1173 1173 if (pchLine && cchLine) 1174 RTStrmWrite(pState->pDiff, pchLine, cchLine); 1174 { 1175 if (!pState->fSpecialChars) 1176 RTStrmWrite(pState->pDiff, pchLine, cchLine); 1177 else 1178 { 1179 size_t offVir = 0; 1180 const char *pchStart = pchLine; 1181 const char *pchTab = (const char *)memchr(pchLine, '\t', cchLine); 1182 while (pchTab) 1183 { 1184 RTStrmWrite(pState->pDiff, pchStart, pchTab - pchStart); 1185 offVir += pchTab - pchStart; 1186 1187 size_t cchTab = g_cchTab - offVir % g_cchTab; 1188 switch (cchTab) 1189 { 1190 case 1: RTStrmPutStr(pState->pDiff, "."); break; 1191 case 2: RTStrmPutStr(pState->pDiff, ".."); break; 1192 case 3: RTStrmPutStr(pState->pDiff, "[T]"); break; 1193 case 4: RTStrmPutStr(pState->pDiff, "[TA]"); break; 1194 case 5: RTStrmPutStr(pState->pDiff, "[TAB]"); break; 1195 default: RTStrmPrintf(pState->pDiff, "[TAB%.*s]", cchTab - 5, g_szTabSpaces); break; 1196 } 1197 offVir += cchTab; 1198 1199 /* next */ 1200 pchStart = pchTab + 1; 1201 pchTab = (const char *)memchr(pchStart, '\t', cchLine - (pchStart - pchLine)); 1202 } 1203 size_t cchLeft = cchLine - (pchStart - pchLine); 1204 if (cchLeft) 1205 RTStrmWrite(pState->pDiff, pchStart, cchLeft); 1206 } 1207 } 1175 1208 1176 1209 if (!pState->fSpecialChars) … … 1452 1485 * @param fIgnoreTrailingWhite Set if trailing white space should be ignored. 1453 1486 * @param fSpecialChars Whether to print special chars in a human 1454 * readable form or not. Currently only applicable 1455 * to the EOL marker. 1487 * readable form or not. 1456 1488 * @param pDiff Where to write the diff. 1457 1489 */
Note:
See TracChangeset
for help on using the changeset viewer.

