Use macroses GOLD_SLASH_CHR GOLD_SLASH_STR GOLD_WRONG_SLASH_CHR GOLD_WRONG_SLASH_STR instead string and char constatnts / and \

This commit is contained in:
Stas Degteff
2011-02-14 00:27:05 +00:00
parent 2202849fb2
commit 76da9f5b0f
7 changed files with 26 additions and 24 deletions

View File

@@ -458,10 +458,10 @@ bool CMYSpellLang::Init(const gdirentry *entry)
if (entry2)
{
strcpy(mEngine, entry2->dirname);
strcat(mEngine, "/");
strcat(mEngine, GOLD_SLASH_STR);
strcat(mEngine, entry2->name.c_str());
strcpy(mDictionary, entry->dirname);
strcat(mDictionary, "/");
strcat(mDictionary, GOLD_SLASH_STR);
strcat(mDictionary, entry->name.c_str());
return true;

View File

@@ -105,7 +105,7 @@ int strschg_environ(std::string& s) {
}
if(pe != NULL) {
std::string dirname = pe->pw_dir;
dirname += "/";
dirname += GOLD_SLASH_CHR;
if(isslash(*p))
++p;
dirname += p;
@@ -185,7 +185,7 @@ bool maketruepath(std::string &dirname) {
ndirname = chdrive;
else {
ndirname = dwd;
ndirname += "/";
ndirname += GOLD_SLASH_CHR;
}
ndirname += dirname.c_str() + inspos;
dirname = ndirname;
@@ -211,7 +211,7 @@ bool maketruepath(std::string &dirname) {
struct passwd *pe = getpwnam(ndirname.c_str()); // get home
if(pe != NULL) {
ndirname = pe->pw_dir;
ndirname += "/";
ndirname += GOLD_SLASH_CHR;
if(isslash(*p))
++p;
ndirname += p;
@@ -222,7 +222,7 @@ bool maketruepath(std::string &dirname) {
}
} else if(not dirname.empty() and not isslash(dirname[0])) {
ndirname = cwd;
ndirname += "/";
ndirname += GOLD_SLASH_CHR;
ndirname += dirname;
dirname = ndirname;
}

View File

@@ -2267,7 +2267,7 @@ static void ShowStackRM( HANDLE hThread, CONTEXT& c, FILE *fLogFile, PREAD_PROCE
for ( p = tt + strlen( tt ) - 1; p >= tt; -- p )
{
// locate the rightmost path separator
if ( *p == '\\' || *p == '/' || *p == ':' )
if ( *p == GOLD_SLASH_CHR || *p == GOLD_WRONG_SLASH_CHR || *p == ':' )
break;
}
// if we found one, p is pointing at it; if not, tt only contains