Arkady V.Belousov wrote:
Салям!18-Июл-2005 02:34 [EMAIL PROTECTED] (Kenneth Davis) wrote to [EMAIL PROTECTED]: KD> --- dir.c 10 Jul 2005 04:46:38 -0000 1.20 KD> +++ dir.c 18 Jul 2005 02:34:28 -0000 1.21 KD> @@ -1259,12 +1259,15 @@ KD> if (rest && *rest) KD> { [...] KD> if ((strlen(rest) != 2) || (rest[1] != ':')) if (rest && *rest) { if (rest [1] != ':' || rest [2] != '\0') KD> + drive = toupper(rest[0]) - 'A'; Here not checked, that rest [0] is a letter. PS: :)
true, but according to TC docs, toupper() supports EOF (-1 I believe) to 255 and any non-lowercase item is returned unchanged; so no check should be necessary. I suppose we could explicitly check for a letter argument and return syntax error if not (since not a drive usually), then change to use _toupper macro or even straight bit manipulation (anding off bit 5 I think).
Jeremy :-) ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click _______________________________________________ Freedos-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freedos-devel
