[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bash-2.04 vs glibc-2.2.1
From: |
Michal Maru?¹ka |
Subject: |
Bash-2.04 vs glibc-2.2.1 |
Date: |
Tue, 06 Feb 2001 23:28:43 GMT |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.2 (Terspichore) |
I upgraded to glibc-2.2.1. (from 2.1.2).
I tried to compile Bash-2.04 (i've had it on my HD for a year since i tried
to install it w/o success).
After a while i noticed that glob-expansion doesn't work. Precisely: it
expands, but the result is wrong. So:
$ echo *
gives 2 empty lines.
$ ls *
gives
ls: : No such file or directory
for each file/dir expanded (i think).
My solution:
I looked at pathexp.c. I did _not_ read it for a long, but noticed a
possibility
for the use of an external globbing library. So I switched to it (seems
builtin in Glibc now).
Patches follow: (I can't find anything about USE_POSIX_GLOB_LIBRARY in
configure!?)
diff -c /internet/gnu/bash-2.04/config.h.~1~ /internet/gnu/bash-2.04/config.h
*** /internet/gnu/bash-2.04/config.h.~1~ Mon Feb 5 22:50:07 2001
--- /internet/gnu/bash-2.04/config.h Mon Feb 5 22:50:07 2001
***************
*** 627,630 ****
--- 627,634 ----
#include "config-bot.h"
+
+ /* New glibc 2.2 includes the glob functions! */
+ #define USE_POSIX_GLOB_LIBRARY 1
+
#endif /* _CONFIG_H_ */
diff -c /internet/gnu/bash-2.04/pathexp.c.~1~ /internet/gnu/bash-2.04/pathexp.c
*** /internet/gnu/bash-2.04/pathexp.c.~1~ Mon Feb 5 22:47:33 2001
--- /internet/gnu/bash-2.04/pathexp.c Mon Feb 5 22:47:33 2001
***************
*** 169,175 ****
{
#if defined (USE_POSIX_GLOB_LIBRARY)
register int i;
! char *temp, **return_value;
glob_t filenames;
int glob_flags;
--- 169,175 ----
{
#if defined (USE_POSIX_GLOB_LIBRARY)
register int i;
! char *temp, **results;
glob_t filenames;
int glob_flags;
***************
*** 189,195 ****
free (temp);
! if (i == GLOB_NOSPACE || i == GLOB_ABEND)
return ((char **)NULL);
else if (i == GLOB_NOMATCH)
filenames.gl_pathv = (char **)NULL;
--- 189,195 ----
free (temp);
! if (i == GLOB_NOSPACE || i == GLOB_ABORTED)
return ((char **)NULL);
else if (i == GLOB_NOMATCH)
filenames.gl_pathv = (char **)NULL;
BTW: I noticed Bash has programmable completion, like Zsh (to which i am
migrating
slowly). How do the (bash /zsh ) compare ?
--
Michal Maruska
- Bash-2.04 vs glibc-2.2.1,
Michal Maru?¹ka <=