Thread View: gnu.bash.bug
1 messages
1 total messages
Started by Ray Moody
Fri, 04 Aug 1989 01:04
bash -c and aliases
Author: Ray Moody
Date: Fri, 04 Aug 1989 01:04
Date: Fri, 04 Aug 1989 01:04
81 lines
2571 bytes
2571 bytes
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"
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads