Skip to content

Commit

Permalink
Better handling of spaces in paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jansorg committed Oct 9, 2024
1 parent 0a952da commit ca1698c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bashdb-main.inc.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ typeset _Dbg_release='@PACKAGE_VERSION@'
typeset _Dbg_bashdb_main='@DBGR_MAIN@'

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

# Original $0. Note we can't set this in an include.
typeset _Dbg_orig_0=$0
typeset _Dbg_orig_0="$0"

# Equivalent to basename $0; the short program name
typeset _Dbg_pname=${0##*/}
typeset _Dbg_pname="${0##*/}"

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

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

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

# Pull in the rest of the debugger code.
. $_Dbg_main
. "$_Dbg_main"

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

0 comments on commit ca1698c

Please sign in to comment.