[21631] | 1 | #include <stdio.h>
|
---|
| 2 | #include <windows.h>
|
---|
| 3 | #include <tchar.h>
|
---|
| 4 |
|
---|
| 5 | #ifndef _MSC_VER
|
---|
| 6 |
|
---|
| 7 | #include <odinlx.h>
|
---|
| 8 |
|
---|
| 9 | #include <minivcrt.h>
|
---|
| 10 |
|
---|
| 11 | int _main();
|
---|
| 12 | int _argc;
|
---|
| 13 | char **_argv;
|
---|
| 14 |
|
---|
| 15 | int WIN32API WinMain(HANDLE hInstance,
|
---|
| 16 | HANDLE hPrevInstance,
|
---|
| 17 | LPSTR lpCmdLine,
|
---|
| 18 | int nCmdShow)
|
---|
| 19 | {
|
---|
| 20 | return _main(_argc, _argv);
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | int main(int argc, char **argv)
|
---|
| 24 | {
|
---|
| 25 | _argc = argc;
|
---|
| 26 | _argv = argv;
|
---|
[21999] | 27 | #ifdef ODIN_FORCE_WIN32_TIB
|
---|
| 28 | ForceWin32TIB();
|
---|
| 29 | #endif
|
---|
[21631] | 30 | RegisterLxExe(WinMain, NULL);
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | #else
|
---|
| 34 | #define _main main
|
---|
| 35 | #endif
|
---|
| 36 |
|
---|
| 37 | static void test_fullpath(const char *path)
|
---|
| 38 | {
|
---|
| 39 | char fullPath[MAX_PATH];
|
---|
| 40 | _fullpath(fullPath, path, sizeof(fullPath));
|
---|
| 41 | printf("### [%s] => [%s]\n", path, fullPath);
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | static void do_test_fullpath()
|
---|
| 45 | {
|
---|
| 46 | test_fullpath("");
|
---|
| 47 | test_fullpath("\\");
|
---|
| 48 | test_fullpath("\\\\\\\\");
|
---|
| 49 | test_fullpath(".");
|
---|
| 50 | test_fullpath(".\\");
|
---|
| 51 | test_fullpath("\\.");
|
---|
| 52 | test_fullpath("\\.\\");
|
---|
| 53 | test_fullpath("..");
|
---|
| 54 | test_fullpath("..\\");
|
---|
| 55 | test_fullpath("\\..");
|
---|
| 56 | test_fullpath("\\..\\");
|
---|
| 57 | test_fullpath("a\\b");
|
---|
| 58 | test_fullpath("\\a\\b");
|
---|
| 59 | test_fullpath("a\\b\\");
|
---|
| 60 | test_fullpath("\\a\\b\\");
|
---|
| 61 | test_fullpath("d:\\a\\b");
|
---|
| 62 | test_fullpath("d:\\a\\b\\");
|
---|
| 63 | test_fullpath("d:\\a\\b\\\\");
|
---|
| 64 | test_fullpath("d:\\a\\\\b\\c\\\\d");
|
---|
| 65 | test_fullpath("d:\\a\\.\\.\\b\\c\\.\\.\\.\\d");
|
---|
| 66 | test_fullpath("d:\\..\\..\\.\\");
|
---|
| 67 | test_fullpath("d:\\a\\\\b\\c\\\\d\\..\\e");
|
---|
| 68 | test_fullpath("d:\\a\\\\b\\c\\\\d\\..\\..\\e");
|
---|
| 69 | test_fullpath("d:\\a\\\\b\\c\\\\d\\..\\..\\..\\e");
|
---|
| 70 | test_fullpath("d:\\a\\\\b\\c\\\\d\\..\\..\\\\..\\e");
|
---|
| 71 | test_fullpath("d:\\a\\\\b\\c\\\\d\\..\\..\\..\\..\\e");
|
---|
| 72 | test_fullpath("d:\\a\\\\b\\c\\\\d\\..\\..\\..\\..\\..\\e");
|
---|
| 73 | test_fullpath("d\\a\\\\b\\c\\\\d\\..\\..\\..\\..\\..\\e");
|
---|
| 74 | }
|
---|
| 75 |
|
---|
| 76 | int _main(int argc, char **argv)
|
---|
| 77 | {
|
---|
| 78 | do_test_fullpath();
|
---|
| 79 |
|
---|
| 80 | return 0;
|
---|
| 81 | }
|
---|