Skip to content

Commit 085479a

Browse files
committed
Shell (Windows): fallback shell version detection to file version
1 parent 482b15c commit 085479a

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/detection/terminalshell/terminalshell.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,6 @@ static bool getShellVersionWinPowerShell(FFstrbuf* exe, FFstrbuf* version)
121121
ffStrbufSubstrAfterLastC(version, ' ');
122122
return true;
123123
}
124-
125-
static bool getShellVersionCmd(FFstrbuf* exe, FFstrbuf* version)
126-
{
127-
return getFileVersion(exe->chars, version);
128-
}
129124
#endif
130125

131126
bool fftsGetShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* version)
@@ -151,11 +146,11 @@ bool fftsGetShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* version)
151146
#ifdef _WIN32
152147
if(strcasecmp(exeName, "powershell") == 0 || strcasecmp(exeName, "powershell_ise") == 0)
153148
return getShellVersionWinPowerShell(exe, version);
154-
if(strcasecmp(exeName, "cmd") == 0)
155-
return getShellVersionCmd(exe, version);
156-
#endif
157149

150+
return getFileVersion(exe->chars, version);
151+
#else
158152
return false;
153+
#endif
159154
}
160155

161156
FF_MAYBE_UNUSED static bool getTerminalVersionTermux(FFstrbuf* version)

0 commit comments

Comments
 (0)