Skip to content

Commit bee98b2

Browse files
authored
Check executable for *w.exe names. (#153)
Fixes #152
1 parent eff7e02 commit bee98b2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/pymanager/main.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,31 +129,35 @@ per_exe_settings(
129129
}
130130
const wchar_t *name = &argv0[n];
131131
#endif
132-
if (CompareStringOrdinal(name, cch, L"python", -1, TRUE) == CSTR_EQUAL) {
132+
if (CompareStringOrdinal(name, cch, L"python", -1, TRUE) == CSTR_EQUAL
133+
|| CompareStringOrdinal(name, cch, L"pythonw", -1, TRUE) == CSTR_EQUAL) {
133134
*default_command = NULL;
134135
*commands = false;
135136
*cli_tag = false;
136137
*shebangs = argc >= 2;
137138
*autoinstall = false;
138139
return;
139140
}
140-
if (CompareStringOrdinal(name, cch, L"python3", -1, TRUE) == CSTR_EQUAL) {
141+
if (CompareStringOrdinal(name, cch, L"python3", -1, TRUE) == CSTR_EQUAL
142+
|| CompareStringOrdinal(name, cch, L"pythonw3", -1, TRUE) == CSTR_EQUAL) {
141143
*default_command = NULL;
142144
*commands = false;
143145
*cli_tag = false;
144146
*shebangs = argc >= 2;
145147
*autoinstall = false;
146148
return;
147149
}
148-
if (CompareStringOrdinal(name, cch, L"py", -1, TRUE) == CSTR_EQUAL) {
150+
if (CompareStringOrdinal(name, cch, L"py", -1, TRUE) == CSTR_EQUAL
151+
|| CompareStringOrdinal(name, cch, L"pyw", -1, TRUE) == CSTR_EQUAL) {
149152
*default_command = NULL;
150153
*commands = argc >= 2;
151154
*cli_tag = argc >= 2;
152155
*shebangs = argc >= 2;
153156
*autoinstall = argc >= 2 && !wcscmp(argv[1], L"exec");
154157
return;
155158
}
156-
if (CompareStringOrdinal(name, cch, L"pymanager", -1, TRUE) == CSTR_EQUAL) {
159+
if (CompareStringOrdinal(name, cch, L"pymanager", -1, TRUE) == CSTR_EQUAL
160+
|| CompareStringOrdinal(name, cch, L"pywmanager", -1, TRUE) == CSTR_EQUAL) {
157161
*default_command = argc >= 2 ? L"**help_with_error" : L"help";
158162
*commands = argc >= 2;
159163
*cli_tag = false;

0 commit comments

Comments
 (0)