bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] fix bashdb script handling of tmp directory


From: devin
Subject: [PATCH] fix bashdb script handling of tmp directory
Date: Wed, 21 Sep 2005 10:53:47 -0700

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H  -I.  -I../bash -I../bash/include -I../bash/lib   -g -O2
uname output: Linux dungeon2 2.6.11-1-k7-smp #1 SMP Mon Jun 20 22:34:51 MDT 
2005 i686 GNU/Linux
Machine Type: i386-pc-linux-gnu

Bash Version: 3.0
Patch Level: 16
Release Status: release

Description:
        Using bashdb on scripts with directory components in their names
        failes because it tried to create a temporary file in tmp
        without stripping the directories and it failes becuase the
        directories do not exist.

Fix:
        Included is a patch that strips the directory names from 
        $_guineapig before creating a temporary file.

        For good measure it also strips the dirs before outputing the
        lines in the file.  It just makes it look better.

--- old-bashdb  2005-09-21 10:26:32.000000000 -0700
+++ bashdb      2005-09-21 10:48:12.000000000 -0700
@@ -509,11 +509,11 @@
   fi

   if (( $line < 100 )); then
-    _msg "$_guineapig:$line   $bp $cl${_lines[$line]}"
+    _msg "${_guineapig/*\//}:$line   $bp $cl${_lines[$line]}"
   elif (( $line < 10 )); then
-    _msg "$_guineapig:$line  $bp $cl${_lines[$line]}"
+    _msg "${_guineapig/*\//}:$line  $bp $cl${_lines[$line]}"
   elif (( $line > 0 )); then
-    _msg "$_guineapig:$line $bp $cl${_lines[$line]}"
+    _msg "${_guineapig/*\//}:$line $bp $cl${_lines[$line]}"
   fi
 }

@@ -564,7 +564,7 @@
 let _i=1

 # Be careful about quoted newlines
-_potbelliedpig=${TMPDIR-/tmp}/$_guineapig.$$
+_potbelliedpig=${TMPDIR-/tmp}/${_guineapig/*\//}.$$
 sed 's,\\$,\\\\,' $_guineapig > $_potbelliedpig

Thanks,
Devin Bayer





reply via email to

[Prev in Thread] Current Thread [Next in Thread]