Date: Sun, 30 Jun 2002 15:47:07 +0100 From: "Richard Dawe" Sender: rich AT phekda DOT freeserve DOT co DOT uk To: djgpp-workers AT delorie DOT com X-Mailer: Emacs 21.3.50 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6 Subject: Patch: findfirst and large attrib values Message-Id: Reply-To: djgpp-workers AT delorie DOT com Hello. Below is a patch including a changelog entry for the bug I noticed in findfirst recently. OK to commit? Since the code change has been OK'd already, I won't wait the full week to commit, once it's approved. Thanks, bye, Rich =] Index: src/libc/dos/dir/findfirs.c =================================================================== RCS file: /cvs/djgpp/djgpp/src/libc/dos/dir/findfirs.c,v retrieving revision 1.2 diff -p -u -3 -r1.2 findfirs.c --- src/libc/dos/dir/findfirs.c 31 Aug 1996 21:09:32 -0000 1.2 +++ src/libc/dos/dir/findfirs.c 30 Jun 2002 14:38:25 -0000 @@ -23,6 +23,11 @@ findfirst(const char *pathname, struct f return -1; } + /* The low 8 bits are the allowable attributes; the next 8 bits + are the required attributes. We have no required attributes, + so mask off bits 8-15. */ + attrib &= 0xff; + pathlen = strlen(pathname) + 1; _put_path(pathname); Index: src/docs/kb/wc204.txi =================================================================== RCS file: /cvs/djgpp/djgpp/src/docs/kb/wc204.txi,v retrieving revision 1.116 diff -p -u -3 -r1.116 wc204.txi --- src/docs/kb/wc204.txi 24 Jun 2002 19:28:45 -0000 1.116 +++ src/docs/kb/wc204.txi 30 Jun 2002 14:38:30 -0000 @@ -762,3 +762,8 @@ Previously @code{pow(x,y)} returned 0 wh A bug was fixed in the function @code{pow} in @file{libc.a}. Previously @code{pow} may have failed for negative numbers with a large magnitude. + +@findex findfirst +A bug was fixed in the function @code{findfirst}. Previously +unexpected behaviour may have resulted, if the attribute argument +had a value outside the range describable by the @code{FA_*} constants.