mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-29 00:19:51 +02:00
commit bash-20070823 snapshot
This commit is contained in:
@@ -14831,3 +14831,17 @@ examples/loadables/Makefile.in
|
||||
|
||||
examples/loadables/{basename,cut,dirname,finfo,head,ln,logname,mkdir,pathchk,print,printenv,push,realpath,rmdir,sleep,tee,truefalse,tty,uname,unlink,whoami}.c
|
||||
- fix up some includes. Fix from Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
8/21
|
||||
----
|
||||
histexpand.c
|
||||
- fix another memory leak in history_find_word. Bug report originally
|
||||
from Michael Snyder <msnyder@sonic.net>; test case suggested by Jim
|
||||
Blandy <jimb@codesourcery.com>
|
||||
|
||||
8/26
|
||||
----
|
||||
subst.c
|
||||
- change to do_assignment_internal to make an assignment to a variable
|
||||
with the `noassign' internal attribute not a variable assignment
|
||||
error.
|
||||
|
||||
+16
-1
@@ -14829,4 +14829,19 @@ examples/loadables/Makefile.in
|
||||
- add @LDFLAGS@ to SHOBJ_LDFLAGS assignment -- experimental. Suggested
|
||||
by Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
examples/loadables/{
|
||||
examples/loadables/{basename,cut,dirname,finfo,head,ln,logname,mkdir,pathchk,print,printenv,push,realpath,rmdir,sleep,tee,truefalse,tty,uname,unlink,whoami}.c
|
||||
- fix up some includes. Fix from Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
8/21
|
||||
----
|
||||
histexpand.c
|
||||
- fix another memory leak in history_find_word. Bug report originally
|
||||
from Michael Snyder <msnyder@sonic.net>; test case suggested by Jim
|
||||
Blandy <jimb@codesourcery.com>
|
||||
|
||||
8/26
|
||||
----
|
||||
subst.c
|
||||
- change to do_assignment_internal to make an assignment to a variable
|
||||
with the `noassign' internal attribute not a variable assignment
|
||||
error
|
||||
|
||||
+4
-3
@@ -23,16 +23,17 @@ $PRODUCES exec.c
|
||||
|
||||
$BUILTIN exec
|
||||
$FUNCTION exec_builtin
|
||||
$SHORT_DOC exec [-cl] [-a name] [command [arguments ...]]
|
||||
$SHORT_DOC exec [-cl] [-a name] [command [arguments ...]] [redirection ...]
|
||||
Execute COMMAND, replacing this shell with the specified program.
|
||||
ARGUMENTS become the arguments to COMMAND. If COMMAND is not specified,
|
||||
any redirections take effect in the current shell. If the `-l' option
|
||||
is supplied, the shell places a dash in the zeroth argument to the
|
||||
COMMAND, as login does. If the `-c' option is supplied, COMMAND is
|
||||
executed with an empty environment. The `-a' option causes the shell
|
||||
to pass NAME as the zeroth argument to COMMAND. If the file cannot be
|
||||
to pass NAME as the zeroth argument to COMMAND. If the command cannot be
|
||||
executed, a non-interactive shell exits, unless the shell option `execfail'
|
||||
is set.
|
||||
is set. If COMMAND is absent, any redirections specified take effect in the
|
||||
calling shell.
|
||||
$END
|
||||
|
||||
#include <config.h>
|
||||
|
||||
+12
-10
@@ -1,7 +1,7 @@
|
||||
This file is exec.def, from which is created exec.c.
|
||||
It implements the builtin "exec" in Bash.
|
||||
|
||||
Copyright (C) 1987-2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-2007 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -23,15 +23,17 @@ $PRODUCES exec.c
|
||||
|
||||
$BUILTIN exec
|
||||
$FUNCTION exec_builtin
|
||||
$SHORT_DOC exec [-cl] [-a name] file [redirection ...]
|
||||
Execute FILE, replacing this shell with the specified program.
|
||||
If FILE is not specified, the redirections take effect in this
|
||||
shell. If the first argument is `-l', then place a dash in the
|
||||
zeroth arg passed to FILE, as login does. If the `-c' option
|
||||
is supplied, FILE is executed with a null environment. The `-a'
|
||||
option means set argv[0] of the executed process to NAME.
|
||||
If the file cannot be executed and the shell is not interactive,
|
||||
then the shell exits, unless the shell option `execfail' is set.
|
||||
$SHORT_DOC exec [-cl] [-a name] [command [arguments ...]] [redirection ...]
|
||||
Execute COMMAND, replacing this shell with the specified program.
|
||||
ARGUMENTS become the arguments to COMMAND. If COMMAND is not specified,
|
||||
any redirections take effect in the current shell. If the `-l' option
|
||||
is supplied, the shell places a dash in the zeroth argument to the
|
||||
COMMAND, as login does. If the `-c' option is supplied, COMMAND is
|
||||
executed with an empty environment. The `-a' option causes the shell
|
||||
to pass NAME as the zeroth argument to COMMAND. If the command cannot be
|
||||
executed, a non-interactive shell exits, unless the shell option `execfail'
|
||||
is set. If COMMAND is absent, any redirections take effect in the
|
||||
calling shell.
|
||||
$END
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -64,10 +64,11 @@ static int subst_lhs_len;
|
||||
static int subst_rhs_len;
|
||||
|
||||
static char *get_history_word_specifier PARAMS((char *, char *, int *));
|
||||
static char *history_find_word PARAMS((char *, int));
|
||||
static int history_tokenize_word PARAMS((const char *, int));
|
||||
static char **history_tokenize_internal PARAMS((const char *, int, int *));
|
||||
static char *history_substring PARAMS((const char *, int, int));
|
||||
static void freewords PARAMS((char **, int));
|
||||
static char *history_find_word PARAMS((char *, int));
|
||||
|
||||
static char *quote_breaks PARAMS((char *));
|
||||
|
||||
@@ -1570,6 +1571,18 @@ history_tokenize (string)
|
||||
return (history_tokenize_internal (string, -1, (int *)NULL));
|
||||
}
|
||||
|
||||
/* Free members of WORDS from START to an empty string */
|
||||
static void
|
||||
freewords (words, start)
|
||||
char **words;
|
||||
int start;
|
||||
{
|
||||
register int i;
|
||||
|
||||
for (i = start; words[i]; i++)
|
||||
free (words[i]);
|
||||
}
|
||||
|
||||
/* Find and return the word which contains the character at index IND
|
||||
in the history line LINE. Used to save the word matched by the
|
||||
last history !?string? search. */
|
||||
@@ -1584,14 +1597,15 @@ history_find_word (line, ind)
|
||||
words = history_tokenize_internal (line, ind, &wind);
|
||||
if (wind == -1 || words == 0)
|
||||
{
|
||||
if (words)
|
||||
freewords (words, 0);
|
||||
FREE (words);
|
||||
return ((char *)NULL);
|
||||
}
|
||||
s = words[wind];
|
||||
for (i = 0; i < wind; i++)
|
||||
free (words[i]);
|
||||
for (i = wind + 1; words[i]; i++)
|
||||
free (words[i]);
|
||||
freewords (words, wind + 1);
|
||||
free (words);
|
||||
return s;
|
||||
}
|
||||
|
||||
+1
-1
@@ -25,6 +25,6 @@
|
||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
#define PATCHLEVEL 17
|
||||
#define PATCHLEVEL 25
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/* patchlevel.h -- current bash patch level */
|
||||
|
||||
/* Copyright (C) 2001-2006 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2001-2007 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
#define PATCHLEVEL 9
|
||||
#define PATCHLEVEL 17
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
|
||||
@@ -2279,7 +2279,7 @@ do_assignment_internal (word, expand)
|
||||
const WORD_DESC *word;
|
||||
int expand;
|
||||
{
|
||||
int offset, tlen, appendop, assign_list, aflags;
|
||||
int offset, tlen, appendop, assign_list, aflags, retval;
|
||||
char *name, *value;
|
||||
SHELL_VAR *entry;
|
||||
#if defined (ARRAY_VARS)
|
||||
@@ -2370,11 +2370,27 @@ do_assignment_internal (word, expand)
|
||||
|
||||
stupidly_hack_special_variables (name);
|
||||
|
||||
#if 1
|
||||
/* Return 1 if the assignment seems to have been performed correctly. */
|
||||
if (entry == 0 || readonly_p (entry))
|
||||
retval = 0; /* assignment failure */
|
||||
else if (noassign_p (entry))
|
||||
{
|
||||
last_command_exit_value = EXECUTION_FAILURE;
|
||||
retval = 1; /* error status, but not assignment failure */
|
||||
}
|
||||
else
|
||||
retval = 1;
|
||||
ASSIGN_RETURN (retval);
|
||||
|
||||
if (entry && retval != 0)
|
||||
VUNSETATTR (entry, att_invisible);
|
||||
#else
|
||||
if (entry)
|
||||
VUNSETATTR (entry, att_invisible);
|
||||
|
||||
/* Return 1 if the assignment seems to have been performed correctly. */
|
||||
ASSIGN_RETURN (entry ? ((readonly_p (entry) == 0) && noassign_p (entry) == 0) : 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Perform the assignment statement in STRING, and expand the
|
||||
@@ -7708,7 +7724,6 @@ exp_jump_to_top_level (v)
|
||||
assigning_in_environment = 0;
|
||||
|
||||
top_level_cleanup (); /* from sig.c */
|
||||
|
||||
jump_to_top_level (v);
|
||||
}
|
||||
|
||||
|
||||
@@ -163,8 +163,6 @@ int allow_null_glob_expansion;
|
||||
/* Non-zero means to throw an error when globbing fails to match anything. */
|
||||
int fail_glob_expansion;
|
||||
|
||||
int assigining_in_environment;
|
||||
|
||||
#if 0
|
||||
/* Variables to keep track of which words in an expanded word list (the
|
||||
output of expand_word_list_internal) are the result of globbing
|
||||
@@ -2281,7 +2279,7 @@ do_assignment_internal (word, expand)
|
||||
const WORD_DESC *word;
|
||||
int expand;
|
||||
{
|
||||
int offset, tlen, appendop, assign_list, aflags;
|
||||
int offset, tlen, appendop, assign_list, aflags, retval;
|
||||
char *name, *value;
|
||||
SHELL_VAR *entry;
|
||||
#if defined (ARRAY_VARS)
|
||||
@@ -2375,8 +2373,21 @@ do_assignment_internal (word, expand)
|
||||
if (entry)
|
||||
VUNSETATTR (entry, att_invisible);
|
||||
|
||||
#if 1
|
||||
/* Return 1 if the assignment seems to have been performed correctly. */
|
||||
if (entry == 0 || readonly_p (entry))
|
||||
retval = 0; /* assignment failure */
|
||||
else if (noassign_p (entry))
|
||||
{
|
||||
last_command_exit_value = EXECUTION_FAILURE;
|
||||
retval = 1; /* error status, but not assignment failure */
|
||||
}
|
||||
else
|
||||
retval = 1;
|
||||
ASSIGN_RETURN (retval);
|
||||
#else
|
||||
ASSIGN_RETURN (entry ? ((readonly_p (entry) == 0) && noassign_p (entry) == 0) : 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Perform the assignment statement in STRING, and expand the
|
||||
@@ -4995,7 +5006,7 @@ parameter_brace_expand_word (name, var_is_special, quoted)
|
||||
temp = (*temp && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)))
|
||||
? quote_string (temp)
|
||||
: quote_escapes (temp);
|
||||
else if (atype == 1 && temp && *temp == 0 && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)))
|
||||
else if (atype == 1 && temp && QUOTED_NULL (temp) && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)))
|
||||
rflags |= W_HASQUOTEDNULL;
|
||||
}
|
||||
#endif
|
||||
@@ -7710,7 +7721,6 @@ exp_jump_to_top_level (v)
|
||||
assigning_in_environment = 0;
|
||||
|
||||
top_level_cleanup (); /* from sig.c */
|
||||
|
||||
jump_to_top_level (v);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
BUILD_DIR=/usr/local/build/chet/bash/bash-current
|
||||
BUILD_DIR=/usr/local/build/bash/bash-current
|
||||
THIS_SH=$BUILD_DIR/bash
|
||||
PATH=$PATH:$BUILD_DIR
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
|
||||
./errors.tests: line 61: declare: `/bin/sh': not a valid identifier
|
||||
./errors.tests: line 65: declare: cannot use `-f' to make functions
|
||||
./errors.tests: line 68: exec: -i: invalid option
|
||||
exec: usage: exec [-cl] [-a name] file [redirection ...]
|
||||
exec: usage: exec [-cl] [-a name] [command [arguments ...]] [redirection ...]
|
||||
./errors.tests: line 72: export: XPATH: not a function
|
||||
./errors.tests: line 75: break: only meaningful in a `for', `while', or `until' loop
|
||||
./errors.tests: line 76: continue: only meaningful in a `for', `while', or `until' loop
|
||||
|
||||
@@ -51,6 +51,5 @@ this is ohio-state
|
||||
0
|
||||
1
|
||||
testb
|
||||
bash: no job control in this shell
|
||||
expand_aliases on
|
||||
after
|
||||
|
||||
@@ -51,7 +51,6 @@ this is ohio-state
|
||||
0
|
||||
1
|
||||
testb
|
||||
bash: cannot set terminal pgrp to 15044: Inappropriate ioctl for device
|
||||
bash: no job control in this shell
|
||||
expand_aliases on
|
||||
after
|
||||
|
||||
Reference in New Issue
Block a user