<i>exec+wish fails to handle windows batch file with arguments and spaces</i> status still Open with 3 other changes
by
.
D 2026-10-14T14:58:45.886
J icomment I\stested\sboth\sbranches\s(applied\sto\sthe\scurrent\score-8-6-branch)\son\sWindows\s11,\swith\swish\sand\stclsh.\n\n<b>bug-f91ab723f3-no-cmd</b>\sfixes\sthe\squoting,\sbut\sbreaks\sbatch\sfiles\sin\swish:\swithout\sthe\shidden\sconsole\sof\scmd.exe,\sconsole\sprograms\srun\sfrom\sthe\sbatch\sfile\sget\stheir\sown\sconsoles,\sso\stheir\soutput\sis\slost,\sand\s<tt>ping\s...\s|\sfindstr\s...</tt>\sin\sthe\sbatch\sfile\shangs.\n\n<b>bug-f91ab723f3-quoting</b>\shas\sthe\sright\sidea,\sbut\sthe\sclosing\squote\swas\sappended\safter\sBuildCommandLine()\sconverted\scmdLine\sto\sWCHAR,\sso\sa\ssingle\sbyte\swas\sadded\sto\sa\swide\sstring:\sthe\scommand\sline\sgot\sgarbage\sat\sthe\send\s(e.g.\s<tt>test.bat"A</tt>,\s<tt>8?u</tt>),\sand\smany\scalls\sfailed.\n\nI\scommitted\sa\sfix\son\stop\sof\sit,\sin\sthe\ssame\sbranch\s[/timeline?r=bug-f91ab723f3-quoting|bug-f91ab723f3-quoting]\s(which\sis\sagainst\s8.6):\s[30bc26a91e]\sappends\sthe\squote\sin\sBuildCommandLine()\sbefore\sthe\sconversion.\sWith\sit\sall\scases\swork\sin\swish\sas\sin\stclsh:\sspaces\sin\sthe\spath,\s<code>""</code>,\sarguments\swith\sspaces,\s&\s|\s^\s!,\sembedded\squotes,\s.cmd\sfiles,\sexit\sstatus,\sstdin,\sconsole\sprograms\sand\spipelines\sin\sthe\sbatch\sfile.\swinPipe.test\sand\sexec.test\spass.
J login serhiy.storchaka
J mimetype text/x-fossil-wiki
K f91ab723f3dfbc0d2b720a70a1fa09eebfa1cde5
U serhiy.storchaka
Z 71afe9549dde0a95d347b0ee5338516d