~mpu/qbe

use TMPDIR as a default and `/tmp` as a fallback v1 PROPOSED

Coutinho de Souza: 1
 use TMPDIR as a default and `/tmp` as a fallback

 3 files changed, 5 insertions(+), 5 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~mpu/qbe/patches/49613/mbox | git am -3
Learn more about email & git

[PATCH] use TMPDIR as a default and `/tmp` as a fallback Export this patch

From: Coutinho de Souza <dev@onemoresuza.mailer.me>

---
 minic/mcc     | 6 +++---
 tools/cra.sh  | 2 +-
 tools/test.sh | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/minic/mcc b/minic/mcc
index 492947e..5258aac 100755
--- a/minic/mcc
+++ b/minic/mcc
@@ -31,9 +31,9 @@ then
fi


$DIR/minic < $file          > /tmp/minic.ssa &&
$QBE       < /tmp/minic.ssa > /tmp/minic.s   &&
cc /tmp/minic.s $flags
$DIR/minic < $file          > ${TMPDIR:-/tmp}/minic.ssa &&
$QBE       < ${TMPDIR:-/tmp}/minic.ssa > ${TMPDIR:-/tmp}/minic.s   &&
cc ${TMPDIR:-/tmp}/minic.s $flags

if test $? -ne 0
then
diff --git a/tools/cra.sh b/tools/cra.sh
index 5988267..57a4b34 100755
--- a/tools/cra.sh
+++ b/tools/cra.sh
@@ -2,7 +2,7 @@

DIR=`cd $(dirname "$0"); pwd`
QBE=$DIR/../qbe
BUGF=/tmp/bug.id
BUGF=${TMPDIR:-/tmp}/bug.id
FIND=$1
FIND=${FIND:-afl-find}

diff --git a/tools/test.sh b/tools/test.sh
index 23c6663..fb36222 100755
--- a/tools/test.sh
+++ b/tools/test.sh
@@ -4,7 +4,7 @@ dir=`dirname "$0"`
bin=$dir/../qbe
binref=$dir/../qbe.ref

tmp=/tmp/qbe.zzzz
tmp=${TMPDIR:-/tmp}/qbe.zzzz

drv=$tmp.c
asm=$tmp.s
-- 
2.43.0