Ignore:
Timestamp:
Feb 5, 2005, 11:00:37 PM (21 years ago)
Author:
pr
Message:

Bug 626. Set working directory to that of executable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/cppbase/bs_config.cpp

    r274 r275  
    22792279 *@@added V0.9.1 (2000-02-07) [umoeller]
    22802280 *@@changed V0.9.18 (2002-03-08) [umoeller]: added codec
     2281 *@@changed V1.0.5 (2005-01-25) [pr]: Change directory to that of executable
    22812282 */
    22822283
     
    22902291        strParams += " ";
    22912292        strParams.appendUtf8(&codecProcess, _ustrParams);
     2293    }
     2294
     2295    // V1.0.5 (2005-01-26) [pr]: Change directory to that of executable. @@fixes 626.
     2296    // We remove any leading quotes and just leave the directory name, excluding a
     2297    // trailing slash, unless it is a root directory.
     2298    string    strDir;
     2299    strDir.assignUtf8(&codecProcess, _ustrExecutable);
     2300    strDir = strDir.substr(strDir.find_first_not_of("\"'"));
     2301    size_type pos = strDir.rfind('\\', 0);
     2302    if (pos != string::npos)
     2303    {
     2304        strDir.erase(pos);
     2305        if (strDir.size() == 2 && strDir[1] == ':')
     2306            strDir += '\\';
     2307
     2308        doshSetCurrentDir(strDir.c_str());
    22922309    }
    22932310
Note: See TracChangeset for help on using the changeset viewer.