Skip to content

Commit 6fe938e

Browse files
committed
Better handling of spaces in paths
1 parent 2a1cd2b commit 6fe938e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

bashdb-main.inc.in

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ typeset _Dbg_release='@PACKAGE_VERSION@'
2929
typeset _Dbg_bashdb_main='@DBGR_MAIN@'
3030

3131
# The short shell name. Helps keep code common in bash, zsh, and ksh debuggers.
32-
typeset _Dbg_shell_name=${_Dbg_shell##*/} # Equivalent to basename(_Dbg_shell)
32+
typeset _Dbg_shell_name="${_Dbg_shell##*/}" # Equivalent to basename(_Dbg_shell)
3333

3434
# Original $0. Note we can't set this in an include.
35-
typeset _Dbg_orig_0=$0
35+
typeset _Dbg_orig_0="$0"
3636

3737
# Equivalent to basename $0; the short program name
38-
typeset _Dbg_pname=${0##*/}
38+
typeset _Dbg_pname="${0##*/}"
3939

4040
## Stuff set by autoconf/configure ###
4141
# @PKGDATADIR@ often uses $prefix, _Dbg_libdir must be a global variable
@@ -44,11 +44,11 @@ _Dbg_assign_libdir() { typeset prefix="@prefix@"; _Dbg_libdir="@PKGDATADIR@"; };
4444

4545
# We agonize a bit over _Dbg_libdir: the root directory for where
4646
# debugger code is stored.
47-
[[ -d $_Dbg_libdir ]] || _Dbg_libdir=${_Dbg_bashdb_main%/*} # dirname(_Dbg_bashdb_main)
48-
[[ -d $_Dbg_libdir ]] || _Dbg_libdir='.'
47+
[[ -d "$_Dbg_libdir" ]] || _Dbg_libdir="${_Dbg_bashdb_main%/*}" # dirname(_Dbg_bashdb_main)
48+
[[ -d "$_Dbg_libdir" ]] || _Dbg_libdir='.'
4949

5050
typeset _Dbg_main="$_Dbg_libdir/dbg-main.sh"
51-
if [[ ! -r $_Dbg_main ]] ; then
51+
if [[ ! -r "$_Dbg_main" ]] ; then
5252
echo "${_Dbg_pname}: Can't read debugger library file '${_Dbg_main}'."
5353
echo "${_Dbg_pname}: Perhaps @PACKAGE@ is installed wrong (if its installed)." >&2
5454
echo "${_Dbg_pname}: Try running @PACKAGE@ using -L (with a different directory)." >&2
@@ -57,6 +57,6 @@ if [[ ! -r $_Dbg_main ]] ; then
5757
fi
5858

5959
# Pull in the rest of the debugger code.
60-
. $_Dbg_main
60+
. "$_Dbg_main"
6161

6262
trap '_Dbg_debug_trap_handler 0 "$BASH_COMMAND" "$@"' DEBUG

0 commit comments

Comments
 (0)