Previously, when given a trailing path component with no metacharacters, glob would call stat to check if the provided filename existed, which would fail on a broken symlink. When expanding a pattern however, glob would trust the list of files returned by readdir, and thus would return broken symlinks. Now, be consistent and allow broken symlinks in both cases, by using lstat to determine file existence. If GLOB_MARK is specified, stat must still be used to determine whether a given name refers to a directory or file. But if that fails, a symlink is simply considered to be a file for marking purposes.