mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-02 11:01:35 +08:00
* source.c (openp): Skip $cdir in PATH.
doc/ * gdb.texinfo (Command Files): Document that gdb skips $cdir in search path, and document that gdb only scans the search path if the script's path doesn't specify a directory.
This commit is contained in:
10
gdb/source.c
10
gdb/source.c
@ -764,6 +764,16 @@ openp (const char *path, int opts, const char *string,
|
||||
/* Normal file name in path -- just use it. */
|
||||
strncpy (filename, p, len);
|
||||
filename[len] = 0;
|
||||
|
||||
/* Don't search $cdir. It's also a magic path like $cwd, but we
|
||||
don't have enough information to expand it. The user *could*
|
||||
have an actual directory named '$cdir' but handling that would
|
||||
be confusing, it would mean different things in different
|
||||
contexts. If the user really has '$cdir' one can use './$cdir'.
|
||||
We can get $cdir when loading scripts. When loading source files
|
||||
$cdir must have already been expanded to the correct value. */
|
||||
if (strcmp (filename, "$cdir") == 0)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Remove trailing slashes */
|
||||
|
Reference in New Issue
Block a user