Fossil SCM

ui doesn't work on Windows 9x (portable_system() broken)

Closed

ce73fc217320601… · opened 16 years ago

Type
Code_Defect
Priority
Severity
Minor
Resolution
Wont_Fix
Subsystem
Created
March 17, 2010 10:53 a.m.

On Windows 9x I get "Invalid command or file name" when issuing "fossil ui" command and each time browser sends a request to a fossil server.

The problem is in portable_system() -- 9x doesn't like a hack with double quotes around a command string. Since system(string) function on Windows is implemented as %COMSPEC% /c string, on 9x we get: %COMSPEC% /c ""fossil" http "foo"", which does not work, instead of normal: %COMSPEC% /c "fossil" http "foo", which doesn't work on NT etc.

A hack using double quotes around entire command string on Windows NT (2000, XP etc.) is documented and works because cmd.exe strips the first and the last quote if a command starts with a quote. So there exists another dirty (and IIRC undocumented) hack. We could start command string with something that both cmd.exe and command.com ignore:

%COMSPEC% /c ="fossil" http "foo"
%COMSPEC% /c ="fossil" http foo
%COMSPEC% /c =fossil http "foo"
%COMSPEC% /c =start http://127.0.0.1/

Commands above work just fine both in 9x and NT (up to Windows 7) as long as internal commands like echo or start are NOT quoted (="start" http://127.0.0.1/ doesn't work nor "start" http://127.0.0.1/ does). So, maybe mprintf("=%s", zOrigCmd) would be better? Any other ideas? And yes, I know, that it is 2010 now and 98 must be already dead… :-)

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button