diff options
| author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2026-06-25 00:00:00 +0000 |
|---|---|---|
| committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2026-06-26 11:00:29 +0500 |
| commit | f9d78aff31a5f2521ae7ddbdc97c4a8855808959 (patch) | |
| tree | bf7e13577f75aa4c7c56af1153d6fa15c6052445 /C/Util/7zipInstall | |
| parent | 8c63d71ff886bda90c86db28466287f977374237 (diff) | |
| download | 7zip-main.tar.gz 7zip-main.tar.bz2 7zip-main.zip | |
Diffstat (limited to 'C/Util/7zipInstall')
| -rw-r--r-- | C/Util/7zipInstall/7zipInstall.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/C/Util/7zipInstall/7zipInstall.c b/C/Util/7zipInstall/7zipInstall.c index 7d8e8c4..ce30732 100644 --- a/C/Util/7zipInstall/7zipInstall.c +++ b/C/Util/7zipInstall/7zipInstall.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* 7zipInstall.c - 7-Zip Installer | 1 | /* 7zipInstall.c - 7-Zip Installer |
| 2 | 2024-04-05 : Igor Pavlov : Public domain */ | 2 | : Igor Pavlov : Public domain */ |
| 3 | 3 | ||
| 4 | #include "Precomp.h" | 4 | #include "Precomp.h" |
| 5 | 5 | ||
| @@ -142,7 +142,7 @@ static WCHAR path[MAX_PATH * 2 + 40]; | |||
| 142 | 142 | ||
| 143 | 143 | ||
| 144 | 144 | ||
| 145 | static void CpyAscii(wchar_t *dest, const char *s) | 145 | static void CpyAscii(WCHAR *dest, const char *s) |
| 146 | { | 146 | { |
| 147 | for (;;) | 147 | for (;;) |
| 148 | { | 148 | { |
| @@ -153,13 +153,13 @@ static void CpyAscii(wchar_t *dest, const char *s) | |||
| 153 | } | 153 | } |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | static void CatAscii(wchar_t *dest, const char *s) | 156 | static void CatAscii(WCHAR *dest, const char *s) |
| 157 | { | 157 | { |
| 158 | dest += wcslen(dest); | 158 | dest += wcslen(dest); |
| 159 | CpyAscii(dest, s); | 159 | CpyAscii(dest, s); |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | static void PrintErrorMessage(const char *s1, const wchar_t *s2) | 162 | static void PrintErrorMessage(const char *s1, const WCHAR *s2) |
| 163 | { | 163 | { |
| 164 | WCHAR m[MAX_PATH + 512]; | 164 | WCHAR m[MAX_PATH + 512]; |
| 165 | m[0] = 0; | 165 | m[0] = 0; |
| @@ -196,7 +196,7 @@ static DWORD GetFileVersion(LPCWSTR s) | |||
| 196 | 196 | ||
| 197 | if (!g_version_dll_hModule) | 197 | if (!g_version_dll_hModule) |
| 198 | { | 198 | { |
| 199 | wchar_t buf[MAX_PATH + 100]; | 199 | WCHAR buf[MAX_PATH + 100]; |
| 200 | { | 200 | { |
| 201 | unsigned len = GetSystemDirectoryW(buf, MAX_PATH + 2); | 201 | unsigned len = GetSystemDirectoryW(buf, MAX_PATH + 2); |
| 202 | if (len == 0 || len > MAX_PATH) | 202 | if (len == 0 || len > MAX_PATH) |
| @@ -255,13 +255,13 @@ static WRes MyCreateDir(LPCWSTR name) | |||
| 255 | #define IS_LETTER_CHAR(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z')) | 255 | #define IS_LETTER_CHAR(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z')) |
| 256 | #define IS_DRIVE_PATH(s) (IS_LETTER_CHAR(s[0]) && s[1] == ':' && IS_SEPAR(s[2])) | 256 | #define IS_DRIVE_PATH(s) (IS_LETTER_CHAR(s[0]) && s[1] == ':' && IS_SEPAR(s[2])) |
| 257 | 257 | ||
| 258 | static int ReverseFind_PathSepar(const wchar_t *s) | 258 | static int ReverseFind_PathSepar(const WCHAR *s) |
| 259 | { | 259 | { |
| 260 | int separ = -1; | 260 | int separ = -1; |
| 261 | int i; | 261 | int i; |
| 262 | for (i = 0;; i++) | 262 | for (i = 0;; i++) |
| 263 | { | 263 | { |
| 264 | wchar_t c = s[i]; | 264 | WCHAR c = s[i]; |
| 265 | if (c == 0) | 265 | if (c == 0) |
| 266 | return separ; | 266 | return separ; |
| 267 | if (IS_SEPAR(c)) | 267 | if (IS_SEPAR(c)) |
| @@ -566,7 +566,7 @@ static void NormalizePrefix(WCHAR *s) | |||
| 566 | 566 | ||
| 567 | for (;; i++) | 567 | for (;; i++) |
| 568 | { | 568 | { |
| 569 | const wchar_t c = s[i]; | 569 | const WCHAR c = s[i]; |
| 570 | if (c == 0) | 570 | if (c == 0) |
| 571 | break; | 571 | break; |
| 572 | if (c == '/') | 572 | if (c == '/') |
| @@ -587,10 +587,10 @@ static char MyCharLower_Ascii(char c) | |||
| 587 | return c; | 587 | return c; |
| 588 | } | 588 | } |
| 589 | 589 | ||
| 590 | static wchar_t MyWCharLower_Ascii(wchar_t c) | 590 | static WCHAR MyWCharLower_Ascii(WCHAR c) |
| 591 | { | 591 | { |
| 592 | if (c >= 'A' && c <= 'Z') | 592 | if (c >= 'A' && c <= 'Z') |
| 593 | return (wchar_t)(c + 0x20); | 593 | return (WCHAR)(c + 0x20); |
| 594 | return c; | 594 | return c; |
| 595 | } | 595 | } |
| 596 | 596 | ||
| @@ -976,13 +976,13 @@ static void WriteShellEx(void) | |||
| 976 | } | 976 | } |
| 977 | 977 | ||
| 978 | 978 | ||
| 979 | static const wchar_t *GetCmdParam(const wchar_t *s) | 979 | static const WCHAR *GetCmdParam(const WCHAR *s) |
| 980 | { | 980 | { |
| 981 | unsigned pos = 0; | 981 | unsigned pos = 0; |
| 982 | BoolInt quoteMode = False; | 982 | BoolInt quoteMode = False; |
| 983 | for (;; s++) | 983 | for (;; s++) |
| 984 | { | 984 | { |
| 985 | wchar_t c = *s; | 985 | WCHAR c = *s; |
| 986 | if (c == 0 || (c == L' ' && !quoteMode)) | 986 | if (c == 0 || (c == L' ' && !quoteMode)) |
| 987 | break; | 987 | break; |
| 988 | if (c == L'\"') | 988 | if (c == L'\"') |
| @@ -999,12 +999,12 @@ static const wchar_t *GetCmdParam(const wchar_t *s) | |||
| 999 | } | 999 | } |
| 1000 | 1000 | ||
| 1001 | 1001 | ||
| 1002 | static void RemoveQuotes(wchar_t *s) | 1002 | static void RemoveQuotes(WCHAR *s) |
| 1003 | { | 1003 | { |
| 1004 | const wchar_t *src = s; | 1004 | const WCHAR *src = s; |
| 1005 | for (;;) | 1005 | for (;;) |
| 1006 | { | 1006 | { |
| 1007 | wchar_t c = *src++; | 1007 | WCHAR c = *src++; |
| 1008 | if (c == '\"') | 1008 | if (c == '\"') |
| 1009 | continue; | 1009 | continue; |
| 1010 | *s++ = c; | 1010 | *s++ = c; |
| @@ -1039,7 +1039,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 1039 | CrcGenerateTable(); | 1039 | CrcGenerateTable(); |
| 1040 | 1040 | ||
| 1041 | { | 1041 | { |
| 1042 | const wchar_t *s = GetCommandLineW(); | 1042 | const WCHAR *s = GetCommandLineW(); |
| 1043 | 1043 | ||
| 1044 | #ifndef UNDER_CE | 1044 | #ifndef UNDER_CE |
| 1045 | s = GetCmdParam(s); | 1045 | s = GetCmdParam(s); |
| @@ -1048,7 +1048,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 1048 | for (;;) | 1048 | for (;;) |
| 1049 | { | 1049 | { |
| 1050 | { | 1050 | { |
| 1051 | const wchar_t c = *s; | 1051 | const WCHAR c = *s; |
| 1052 | if (c == 0) | 1052 | if (c == 0) |
| 1053 | break; | 1053 | break; |
| 1054 | if (c == ' ') | 1054 | if (c == ' ') |
| @@ -1059,7 +1059,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 1059 | } | 1059 | } |
| 1060 | 1060 | ||
| 1061 | { | 1061 | { |
| 1062 | const wchar_t *s2 = GetCmdParam(s); | 1062 | const WCHAR *s2 = GetCmdParam(s); |
| 1063 | BoolInt error = True; | 1063 | BoolInt error = True; |
| 1064 | if (cmd[0] == '/') | 1064 | if (cmd[0] == '/') |
| 1065 | { | 1065 | { |
| @@ -1315,7 +1315,7 @@ if (res == SZ_OK) | |||
| 1315 | 1315 | ||
| 1316 | for (;;) | 1316 | for (;;) |
| 1317 | { | 1317 | { |
| 1318 | const wchar_t c = path[i++]; | 1318 | const WCHAR c = path[i++]; |
| 1319 | if (c == 0) | 1319 | if (c == 0) |
| 1320 | break; | 1320 | break; |
| 1321 | if (c != ' ') | 1321 | if (c != ' ') |
