[gnu.bash.bug] bash -c and aliases

ray@GIBBS.PHYSICS.PURDUE.EDU (Ray Moody) (08/04/89)

    Bash -c and aliases don't mix.

    The problem is that the lexer terminates the string given to -c
with \377 (really (char)EOF).  The alias expansion code does not
consider \377 to be whitespace.  If you say "bash -c foo" when foo is
aliased, bash checks to see if foo\377 is aliased to anything.  It
isn't.

								Ray
-------------------------------------------------------------------------------
RCS file: RCS/alias.h,v
retrieving revision 1.2
diff -c -r1.2 alias.h
*** /tmp/,RCSt1006612	Thu Aug  3 20:01:57 1989
--- alias.h	Thu Aug  3 19:20:37 1989
***************
*** 4,10
  #define _ALIAS_
  
  #ifndef whitespace
! #define whitespace(c) (((c) == ' ') || ((c) == '\t'))
  #endif
  
  #ifndef savestring

--- 4,10 -----
  #define _ALIAS_
  
  #ifndef whitespace
! #define whitespace(c) (((c) == ' ') || ((c) == '\t') || ((c) == (char)EOF))
  #endif
  
  #ifndef savestring
===================================================================
RCS file: RCS/general.h,v
retrieving revision 1.2
diff -c -r1.2 general.h
*** /tmp/,RCSt1006612	Thu Aug  3 20:01:57 1989
--- general.h	Thu Aug  3 19:20:39 1989
***************
*** 12,18
  #endif
  
  #ifndef whitespace
! #define whitespace(c) (((c) == ' ') || ((c) == '\t'))
  #endif
  
  #ifndef digit

--- 12,18 -----
  #endif
  
  #ifndef whitespace
! #define whitespace(c) (((c) == ' ') || ((c) == '\t') || ((c) == (char)EOF))
  #endif
  
  #ifndef digit
===================================================================
RCS file: RCS/alias.c,v
retrieving revision 1.2
diff -c -r1.2 alias.c
*** /tmp/,RCSt1006612	Thu Aug  3 20:01:58 1989
--- alias.c	Thu Aug  3 19:52:31 1989
***************
*** 19,24
  with Bash; see the file LICENSE.  If not, write to the Free Software
  Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  
  #include "config.h"
  #include "general.h"
  #include "alias.h"

--- 19,25 -----
  with Bash; see the file LICENSE.  If not, write to the Free Software
  Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  
+ #include <stdio.h>
  #include "config.h"
  #include "general.h"
  #include "alias.h"