summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3095d40)
raw | patch | inline | side by side (parent: 3095d40)
author | jaspervdg <jaspervdg@users.sourceforge.net> | |
Fri, 21 Mar 2008 08:35:54 +0000 (08:35 +0000) | ||
committer | jaspervdg <jaspervdg@users.sourceforge.net> | |
Fri, 21 Mar 2008 08:35:54 +0000 (08:35 +0000) |
src/main.cpp | patch | blob | history |
diff --git a/src/main.cpp b/src/main.cpp
index d86b60540930441ad0c97fa36a5e26aa80e64262..b5ed8305dabff9207613b40face5782c951411cc 100644 (file)
--- a/src/main.cpp
+++ b/src/main.cpp
CHAR szFile[_MAX_FNAME];
CHAR szExt[_MAX_EXT];
- CHAR tmp[_MAX_EXT];
+ std::string tmp;
if (GetModuleFileName(NULL, szFullPath, sizeof(szFullPath)) == 0) {
strcpy(szFullPath, argv0);
strcat(szFullPath, szDir);
char *oldenv = getenv("PATH");
- strcpy(tmp, "PATH=");
- strcat(tmp, szFullPath);
- strcat(tmp, ";");
- strcat(tmp, szFullPath);
- strcat(tmp, "python;");
- strcat(tmp, szFullPath);
- strcat(tmp, "perl;");
+ tmp = "PATH=";
+ tmp += szFullPath;
+ tmp += ";";
+ tmp += szFullPath;
+ tmp += "python;";
+ tmp += szFullPath;
+ tmp += "perl";
if(oldenv != NULL) {
- strcat(tmp, ";");
- strcat(tmp, oldenv);
- }
- _putenv(tmp);
+ tmp += ";";
+ tmp += oldenv;
+ }
+ _putenv(tmp.c_str());
oldenv = getenv("PYTHONPATH");
- strcpy(tmp, "PYTHONPATH=");
- strcat(tmp, szFullPath);
- strcat(tmp, "python;");
- strcat(tmp, szFullPath);
- strcat(tmp, "python\\Lib;");
- strcat(tmp, szFullPath);
- strcat(tmp, "python\\DLLs");
+ tmp = "PYTHONPATH=";
+ tmp += szFullPath;
+ tmp += "python;";
+ tmp += szFullPath;
+ tmp += "python\\Lib;";
+ tmp += szFullPath;
+ tmp += "python\\DLLs";
if(oldenv != NULL) {
- strcat(tmp, ";");
- strcat(tmp, oldenv);
- }
- _putenv(tmp);
+ tmp += ";";
+ tmp += oldenv;
+ }
+ _putenv(tmp.c_str());
return 0;
}