X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=builtins%2Ftype.def;h=bd9ecfc1f8172403ed35ce1b9242ff7efea4c7ab;hb=ac50fbac377e32b98d2de396f016ea81e8ee9961;hp=ee341bb8b0613a32f020233b74f0c409759b5e39;hpb=4539d736f1aff232857a854fd2a68df0c98d9f34;p=platform%2Fupstream%2Fbash.git diff --git a/builtins/type.def b/builtins/type.def index ee341bb..bd9ecfc 100644 --- a/builtins/type.def +++ b/builtins/type.def @@ -1,7 +1,7 @@ This file is type.def, from which is created type.c. It implements the builtin "type" in Bash. -Copyright (C) 1987-2009 Free Software Foundation, Inc. +Copyright (C) 1987-2011 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. @@ -353,7 +353,7 @@ describe_command (command, dflags) user_command_matches (command, FS_EXEC_ONLY, found_file); /* XXX - should that be FS_EXEC_PREFERRED? */ - if (!full_path) + if (full_path == 0) break; /* If we found the command as itself by looking through $PATH, it @@ -375,7 +375,9 @@ describe_command (command, dflags) else if (dflags & (CDESC_REUSABLE|CDESC_PATH_ONLY|CDESC_SHORTDESC)) { f = MP_DOCWD | ((dflags & CDESC_ABSPATH) ? MP_RMDOT : 0); - full_path = sh_makepath ((char *)NULL, full_path, f); + x = sh_makepath ((char *)NULL, full_path, f); + free (full_path); + full_path = x; } } /* If we require a full path and don't have one, make one */