Imported from ../bash-2.02.1.tar.gz.
This commit is contained in:
parent
cce855bc5b
commit
bc4cd23ce9
23 changed files with 204 additions and 70 deletions
|
@ -263,7 +263,7 @@ cd_builtin (list)
|
|||
directory name is echoed to stdout, whether or not
|
||||
the shell is interactive. */
|
||||
if (opt)
|
||||
printf ("%s\n", the_current_working_directory);
|
||||
printf ("%s\n", no_symlinks ? temp : the_current_working_directory);
|
||||
|
||||
free (temp);
|
||||
/* Posix.2 says that after using CDPATH, the resultant
|
||||
|
@ -276,8 +276,10 @@ cd_builtin (list)
|
|||
|
||||
/* POSIX.2 says that if `.' does not appear in $CDPATH, we don't
|
||||
try the current directory, so we just punt now with an error
|
||||
message if POSIXLY_CORRECT is non-zero. */
|
||||
if (posixly_correct)
|
||||
message if POSIXLY_CORRECT is non-zero. The check for cdpath[0]
|
||||
is so we don't mistakenly treat a CDPATH value of "" as not
|
||||
specifying the current directory. */
|
||||
if (posixly_correct && cdpath[0])
|
||||
{
|
||||
builtin_error ("%s: %s", dirname, strerror (ENOENT));
|
||||
return (EXECUTION_FAILURE);
|
||||
|
|
|
@ -191,6 +191,11 @@ exec_builtin (list)
|
|||
#endif /* JOB_CONTROL */
|
||||
|
||||
shell_execve (command, args, env);
|
||||
|
||||
/* We have to set this to NULL because shell_execve has called realloc()
|
||||
to stuff more items at the front of the array, which may have caused
|
||||
the memory to be freed by realloc(). We don't want to free it twice. */
|
||||
args = (char **)NULL;
|
||||
if (cleanenv == 0)
|
||||
adjust_shell_level (1);
|
||||
|
||||
|
|
|
@ -129,6 +129,10 @@ printf_builtin (list)
|
|||
|
||||
garglist = list->next;
|
||||
|
||||
/* If the format string is empty after preprocessing, return immediately. */
|
||||
if (format == 0 || *format == 0)
|
||||
return (EXECUTION_SUCCESS);
|
||||
|
||||
/* Basic algorithm is to scan the format string for conversion
|
||||
specifications -- once one is found, find out if the field
|
||||
width or precision is a '*'; if it is, gather up value. Note,
|
||||
|
@ -305,7 +309,7 @@ printf_builtin (list)
|
|||
fmt[1] = nextch;
|
||||
}
|
||||
}
|
||||
while (garglist);
|
||||
while (garglist && garglist != list->next);
|
||||
|
||||
PRETURN (retval);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue