Skip to content

Commit

Permalink
Don't pollute global variables with "prefix"
Browse files Browse the repository at this point in the history
Function declaration and call are on a single line because the line number is referenced by tests
  • Loading branch information
jansorg committed Oct 9, 2024
1 parent 4aad514 commit 0a952da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bashdb-main.inc.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ typeset _Dbg_orig_0=$0
typeset _Dbg_pname=${0##*/}

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

# We agonize a bit over _Dbg_libdir: the root directory for where
Expand Down
4 changes: 2 additions & 2 deletions bashdb.in
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ typeset _Dbg_orig_0=$0
typeset _Dbg_pname=${0##*/}

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

# We agonize a bit over _Dbg_libdir: the root directory for where
Expand Down

0 comments on commit 0a952da

Please sign in to comment.