Message-ID: <003201c003be$55b0e5e0$26b5c5cb@trr> From: "Prashant TR" To: "Eli Zaretskii" Cc: References: <09c901510100b80CHNSPLP02 AT eth DOT net> Subject: Re: Sh-utils 2.0j sources uploaded Date: Fri, 11 Aug 2000 23:24:45 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Reply-To: djgpp-workers AT delorie DOT com > > Date: Tue, 25 Jul 2000 06:59:03 +0530 (IST) > > From: Prashant TR > > > > 1> I've added some macros to src/system.h to make the code look more > > clean. Could someone please have a look at this and tell me if they're > > fine. > > The macros look good. ISSLASH is not defined except under __MSDOS__; > won't this cause trouble on Unix? This has been corrected in the patches I sent to Jim. > > > 2> djgpp/config.bat edits the makefiles individually. I've added the > > necessary sed scripts for this but for some reason they don't edit the > > makefiles. > > I couldn't figure out what parts exactly didn't work, and what did you > do to work around that. Can you please identify the guilty parties? I meant to say that the configure script doesn't automatically edit the makefiles although arrangements have been made. To get rid of this problem, the batch file now edits lib/Makefile, src/Makefile, etc. This makes the batch file slightly long, and it looks like an unnecessary workaround. But, there are no bugs. It still does the right thing. I tried manually editing the configure script, played around, but couldn't find out what exactly was wrong. > > > These are the final set of patches I'll be sending to the Sh-utils > > maintainer, so any coments are highly appreciated. > > I have a few comments (beyond those I send in a separate mail): > > The DJGPP-specific fragment in tee.c which sets mode_string to "ab" or > "wb", should, I think be replaced by a SET_BINARY call on the file > descriptor returned by `fopen'. I think Jim Meyering explicitly > requested that. I've done this, too, in the patches I sent to Jim. I had also CCed them to you. > About the value of default_shells[] in getusershell.c: perhaps instead > of the environment variable (which Jim Meyering didn't like), it's > better to (1) add "/dev/env/DJDIR/bin/bash.exe" to the list, and (2) > define SHELLS_FILE to "/dev/env/DJDIR/etc/shells" (and add an empty > file to the binary distro), so that users could add/edit that file if > their shell isn't in the list. Done. Check the patch below. If it works fine, I'll send them to Jim. Thanks for the feedback. Prash ---------- --- getusershell.c~0 Fri Aug 11 23:14:10 2000 +++ getusershell.c Fri Aug 11 23:17:24 2000 @@ -21,11 +21,13 @@ # include #endif -#ifndef MSDOS -# ifndef SHELLS_FILE +#ifdef __MSDOS__ +# define SHELLS_FILE "/dev/env/DJDIR/etc/shells" +#endif + +#ifndef SHELLS_FILE /* File containing a list of nonrestricted shells, one per line. */ -# define SHELLS_FILE "/etc/shells" -# endif +# define SHELLS_FILE "/etc/shells" #endif #include @@ -48,6 +50,7 @@ { #ifdef MSDOS "c:/dos/command.com", "c:/windows/command.com", "c:/command.com", + "/dev/env/DJDIR/bin/bash.exe", #endif "/bin/sh", "/bin/csh", "/usr/bin/sh", "/usr/bin/csh", NULL }; @@ -83,7 +86,6 @@ if (shellstream == NULL) { -#ifdef SHELLS_FILE shellstream = fopen (SHELLS_FILE, "r"); if (shellstream == NULL) { @@ -91,11 +93,6 @@ default_index = 1; return xstrdup (default_shells[0]); } -#else - /* No standard place for "/etc/shells"... */ - if (shellstream == NULL && getenv ("SHELLS_FILE")) - shellstream = fopen (getenv ("SHELLS_FILE"), "r"); -#endif } while (readname (&line, &line_size, shellstream)) @@ -111,15 +108,11 @@ void setusershell () { -#ifdef SHELLS_FILE default_index = 0; if (shellstream == NULL) shellstream = fopen (SHELLS_FILE, "r"); else fseek (shellstream, 0L, 0); -#else - shellstream = NULL; -#endif } /* Close the shells file. */