On Fri, Jul 18, 2014 at 3:00 PM, Juan Manuel Guerrero <juan.guerr...@gmx.de>
wrote:
> I do not know if this is the right place to report this FreCom issue and
> I do not know if this issue is already well known but I would like to
> report it anyway.
> Please inspect the following batch file:
>
> @echo off
> @echo %0
> :loop
> @echo %1
> shift
> if not "%1" == "" goto loop
> @echo finished with arguments
>
>
> command.com on MSDOS 6.22, Win98SE and WinXP and also cmd.exe of WinXP
> will produce the following output:
> test.bat
> ./..
> ../.
> if the batch file is started like this:
> test.bat ./.. ../.
>
> If I use FreeCom 0.84-pre2 XMS_Swap [August 28 2006 00:32:15] shipped
> with FreeDOS 1.1 and start the batch file in exactly the same way I get
> the following output:
> test.bat
> .
> /..
> ..
> /.
> As can be seen, FreCom seems to interpret any slash as an option marker
> like in "/?" to get help. All microsoft command.com versions and also
> cmd.exe
> do interpret the slash as an option marker only if it is preceded by some
> kind of blank character. This makes it necessary to quote paths written in
> unix-style like:
> "../foo/bar/."
> if they shall be passed as arguments to a batch file to be processed by
> FreCom.
> Is this behavior a bug or a feature?
>
> Regards,
> Juan M. Guerrero
>
>
In shell/command.c the following patch should fix the issue (assuming
switchar changed).
@@ -331,8 +331,10 @@
break;
case CMD_SPECIAL_DIR: /* pass '\\' & '.' too */
if(*rest == '\\' || *rest == '.' || *rest == ':') break;
+ if (!isoptch(*rest) && *rest == '/') break;
default: /* pass '/', ignore ',', ';' & '=' */
- if(!*rest || *rest == '/') break;
+ if(!*rest || isoptch(*rest)) break;
if(isargdelim(*rest)) {
rest = ltrimcl(rest);
break;
I have uploaded a build to http://www.fdos.org/kernel/command/FreeCom/test/
commandx.com is same as command.com but compressed with UPX
Note this is very minimally tested build.
dif file has a few other minor changes [use switchar for help /? --> -?
and start towards help showing proper switchar]
To change the switchar add
?switchar=-
to config.sys (you can remove the prompt ? if you always want the switchar
changed)
Note: you will need to add a shell line using the proper switchar or you
may get errors about path when /P and /E are parsed as paths instead of
options.
I believe this is based on latest SVN sources, (the diff file is from svn
diff) as compiled with Open Watcom.
Jeremy
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel