Changeset 499 for AE


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

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

Location:
AE/Installer/trunk/source
Files:
2 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;
  • AE/Installer/trunk/source/installer.h

    r487 r499  
    5959bool SortBySize(string, string);
    6060void tokenize(const string&, vector<string>&, const string& delimiters = " ");
     61void StripNewlines(string *);
    6162void clearOldDats(void);
    6263void writeInstalledMods( vector<string> );
Note: See TracChangeset for help on using the changeset viewer.