Imported from ../bash-2.02.tar.gz.
This commit is contained in:
parent
e8ce775db8
commit
cce855bc5b
323 changed files with 33916 additions and 12321 deletions
14
hashcmd.c
14
hashcmd.c
|
|
@ -31,7 +31,7 @@
|
|||
#include "bashansi.h"
|
||||
|
||||
#include "shell.h"
|
||||
#include "execute_cmd.h"
|
||||
#include "findcmd.h"
|
||||
#include "hashcmd.h"
|
||||
|
||||
extern int hashing_enabled;
|
||||
|
|
@ -148,9 +148,15 @@ find_hashed_filename (filename)
|
|||
if (pathdata(item)->flags & (HASH_CHKDOT|HASH_RELPATH))
|
||||
{
|
||||
tail = (pathdata(item)->flags & HASH_RELPATH) ? path : filename;
|
||||
dotted_filename = xmalloc (3 + strlen (tail));
|
||||
dotted_filename[0] = '.'; dotted_filename[1] = '/';
|
||||
strcpy (dotted_filename + 2, tail);
|
||||
/* If the pathname does not start with a `./', add a `./' to it. */
|
||||
if (tail[0] != '.' || tail[1] != '/')
|
||||
{
|
||||
dotted_filename = xmalloc (3 + strlen (tail));
|
||||
dotted_filename[0] = '.'; dotted_filename[1] = '/';
|
||||
strcpy (dotted_filename + 2, tail);
|
||||
}
|
||||
else
|
||||
dotted_filename = savestring (tail);
|
||||
|
||||
if (executable_file (dotted_filename))
|
||||
return (dotted_filename);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue