Mail Archives: djgpp-workers/2000/08/11/14:15:54
> > Date: Tue, 25 Jul 2000 06:59:03 +0530 (IST)
> > From: Prashant TR <tr AT eth DOT net>
> >
> > 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 <config.h>
#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 <stdio.h>
@@ -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. */
- Raw text -