Ignore:
Timestamp:
Mar 3, 2010, 3:09:02 AM (15 years ago)
Author:
iritscen
Message:

I don't fully understand the CR/LF bug, but this fixes it *shrug*.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • AE/Installer/trunk/source/installer.cpp

    r496 r499  
    940940        while (getline(*fileHandler, line))
    941941        {
     942                StripNewlines(&line);
    942943                tokenize(line, tokens);
    943944                iter = tokens.begin();
     
    14711472}
    14721473
     1474/* StripNewlines() gets rids of any linebreaks that come from text returned by getline(); \
     1475|  getline() should be stripping those out, but Windows CR/LF files seem to be sneaking   |
     1476\  some extra return characters into strings in the ReadInstallInfoCfg() function.               */
     1477void StripNewlines(string *theLine)
     1478{
     1479        int deleteFromHere = 0;
     1480        deleteFromHere = theLine->find("\r");
     1481        if (deleteFromHere > 0)
     1482                theLine->erase(deleteFromHere, theLine->size());
     1483}
     1484
    14731485void clearOldDats(void) {
    14741486        directory_iterator end_iter_gdf;
Note: See TracChangeset for help on using the changeset viewer.