[PR gdb/27393] set directories: handle empty dirs.
As reported in gdb/27393, the 'directory' and 'set directories' commands
fail when parsing an empty dir name:
(gdb) set directories ""
/home/lsix/dev/gnu/binutils-gdb/gdbsupport/pathstuff.cc:132: internal-error: gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): Assertion `path != NULL && path[0] != '\0'' failed.
or
(gdb) dir :
/home/lsix/dev/gnu/binutils-gdb/gdbsupport/pathstuff.cc:132: internal-error: gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): Assertion `path != NULL && path[0] != '\0'' failed.
This patch fixes this issue by ignoring any attempt to add an empty
name to the source directories list. 'set dir ""' will reset the
directories list the same way 'set dir' would do it.
Tested on x86_64.