Bug 767827 - TestAUSReadStrings.cpp fails with 'unable to find platform specific path separator' under Pymake on Windows. r=rstrong

This commit is contained in:
Siddharth Agarwal 2012-06-26 22:39:17 +05:30
Родитель ddf203a0bb
Коммит 3802df6966
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -14,6 +14,8 @@
#define NS_tsnprintf _snwprintf
#define NS_T(str) L ## str
#define PATH_SEPARATOR_CHAR L'\\'
// On Windows, argv[0] can also have forward slashes instead
#define ALT_PATH_SEPARATOR_CHAR L'/'
#else
#include <unistd.h>
#define NS_main main
@ -96,6 +98,11 @@ int NS_main(int argc, NS_tchar **argv)
StringTable testStrings;
NS_tchar *slash = NS_tstrrchr(argv[0], PATH_SEPARATOR_CHAR);
#ifdef ALT_PATH_SEPARATOR_CHAR
NS_tchar *altslash = NS_tstrrchr(argv[0], ALT_PATH_SEPARATOR_CHAR);
slash = (slash > altslash) ? slash : altslash;
#endif // ALT_PATH_SEPARATOR_CHAR
if (!slash) {
fail("%s | unable to find platform specific path separator (check 1)", TEST_NAME);
return 20;