For MinGW report an error of the two \\ are not found in the exe path
We need to print a message and fail if the two \\ characters are not found in the executable path.
This commit is contained in:
parent
95d58cbc42
commit
b16401301e
29
vvp/main.cc
29
vvp/main.cc
|
|
@ -263,18 +263,25 @@ int main(int argc, char*argv[])
|
||||||
so we chop the file name and the last directory by
|
so we chop the file name and the last directory by
|
||||||
turning the last two \ characters to null. Then we append
|
turning the last two \ characters to null. Then we append
|
||||||
the lib\ivl$(suffix) to finish. */
|
the lib\ivl$(suffix) to finish. */
|
||||||
{ char *s;
|
char *s;
|
||||||
char basepath[4096], tmp[4096];
|
char basepath[4096], tmp[4096];
|
||||||
GetModuleFileName(NULL, tmp, sizeof tmp);
|
GetModuleFileName(NULL, tmp, sizeof tmp);
|
||||||
/* Convert to a short name to remove any embedded spaces. */
|
/* Convert to a short name to remove any embedded spaces. */
|
||||||
GetShortPathName(tmp, basepath, sizeof basepath);
|
GetShortPathName(tmp, basepath, sizeof basepath);
|
||||||
s = strrchr(basepath, '\\');
|
s = strrchr(basepath, '\\');
|
||||||
if (s) *s = 0;
|
if (s) *s = 0;
|
||||||
s = strrchr(basepath, '\\');
|
else {
|
||||||
if (s) *s = 0;
|
fprintf(stderr, "%s: Missing first \\ in exe path!\n", argv[0]);
|
||||||
strcat(s, "\\lib\\ivl" IVL_SUFFIX);
|
exit(1);
|
||||||
vpip_module_path[0] = strdup(basepath);
|
|
||||||
}
|
}
|
||||||
|
s = strrchr(basepath, '\\');
|
||||||
|
if (s) *s = 0;
|
||||||
|
else {
|
||||||
|
fprintf(stderr, "%s: Missing second \\ in exe path!\n", argv[0]);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
strcat(s, "\\lib\\ivl" IVL_SUFFIX);
|
||||||
|
vpip_module_path[0] = strdup(basepath);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* For non-interactive runs we do not want to run the interactive
|
/* For non-interactive runs we do not want to run the interactive
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue