If I use SET /P to set a parameter from a file / pipe, like
SET /P hello= < world.txt
it will work fine, but if I use it repeatedly, it will continue reading the following lines, and eventually start over, as opposed to keep outputting the first line
(What my Windows XP does).
also: with world.txt containing
world1
world2
01.12.2016
execute
set /p hello1=<world.txt
set /p hello2=<world.txt
date
echo %hello1%
echo %hello2%
echo %date%
should be fixed by maintainer; results from freely mixing
open()/dup() for file redirection, and fgets() for actual input
processing
fix: SHELL\COMMAND.C
int oldinfd = -1; / original file descriptor #0 (stdin) /
int oldoutfd = -1; / original file descriptor #1 (stdout) /
+long oldstdinpos;
...
if (in || (num > 1)) / Need to preserve stdin /
{
oldinfd = dup(0);
+ oldstdinpos = ftell(stdin);
}
...
if (oldinfd != -1) / Restore original STDIN /
{
close(0);
dup2(oldinfd, 0);
+ fseek(stdin, oldstdinpos, SEEK_SET );
}
now I'm wondering how long it takes for
a) a new version of command.com on the website,
b) updateable by the famous FreeDOS 1.0 package management process,
c) updateable by the famous FreeDOS 1.1 package management process, which is different
d) updateable by the famous FreeDOS 1.2 package management process,
which is probably different, again
I can't reproduce this anymore with the newest pre's (which no longer use stream i/o except for debug statements)