VirtualBox

Changeset 26347 in vbox


Ignore:
Timestamp:
Feb 9, 2010 4:26:18 AM (15 years ago)
Author:
vboxsync
Message:

scm: bed time

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bldprogs/scm.cpp

    r26345 r26347  
    274274static PFNSCMREWRITER const g_aRewritersFor_BatchFiles[] =
    275275{
    276     rewrite_ForceLF,
     276    rewrite_ForceCRLF,
    277277    rewrite_ExpandTabs,
    278278    rewrite_StripTrailingBlanks
     
    11721172        RTStrmPutCh(pState->pDiff, chPrefix);
    11731173        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        }
    11751208
    11761209        if (!pState->fSpecialChars)
     
    14521485 * @param   fIgnoreTrailingWhite  Set if trailing white space should be ignored.
    14531486 * @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.
    14561488 * @param   pDiff               Where to write the diff.
    14571489 */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette