Thank you, Bart, for applying my patches, and reviewing the MAX_CDSPATH use!

The following log comment is slightly incorrect:

        prf.c
Log Message:
Borland C (unlike Turbo C) didn't like this pseudo register use.

Actually, *both* Turbo and Borland C didn't like it!


I mentioned a RAR32 bug recently. RAR32 could not find any files in the root directory under FreeDOS. It worked under MS-DOS. The EMX DOS extender it uses is incompatible with SoftICE, so I had to go the hard way. I spent the week end hunting it, found and fixed it. Details follow.

The first GCC/G++ port to DOS is not DJGPP by DJ Delorie, but EMX-GCC/G++ by Eberhard Mattes. Its development stopped in 1998 and DJGPP followed it. Albeit not as popular as its successor, it's still used, especially by OS/2 people. RAR32 is one of the programs compiled with it. It also uses its DOS extender, EMX. So I downloaded and studied the EMX-GCC/G++ library. It has a specific "quirk" in the "glob" function processing. It firstly issues a "Find First" DOS call for "." which must *fail* for the root directory for the function to continue successfully!

This is just what MS-DOS does - an Int 21h AH=4Eh CX=16h (attributes = A_DIR|A_HIDDEN|A_SYSTEM - as the EMX-GCC library sets them) call for "." when the root directory is current *fails* with error code of 18 ("no more files"). And this is quite logical - the root directory does NOT have a '.' entry, so it can't be found! But FreeDOS happily succeeded with this call. After some fiddling with debug kernels and the very old (1987!) but excellent STEPDOS Int 21 tracer (http://www.chiphead.de/pages/stdos.htm), I come up the following patch which fixes the bug.

Lucho

--- cvs/kernel/kernel/dosnames.c        2003-06-15 20:57:02.000000000 +0200
+++ src/kernel/kernel/dosnames.c        2004-03-07 14:02:30.000000000 +0200
@@ -113,6 +113,8 @@
     {
       if (*filename != '\0')
         return DE_FILENOTFND;
+      if (nDirCnt <= 3)         /* "D:\" (D=drive) */
+        return DE_NFILES;       /* root has no '.' */
       memset(fcbname, '?', FNAME_SIZE + FEXT_SIZE);
       return nDirCnt;
     }


------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Freedos-kernel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to