Skip to content

Commit 0a952da

Browse files
committed
Don't pollute global variables with "prefix"
Function declaration and call are on a single line because the line number is referenced by tests
1 parent 4aad514 commit 0a952da

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

bashdb-main.inc.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ typeset _Dbg_orig_0=$0
3838
typeset _Dbg_pname=${0##*/}
3939

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

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

bashdb.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ typeset _Dbg_orig_0=$0
4949
typeset _Dbg_pname=${0##*/}
5050

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

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

0 commit comments

Comments
 (0)