aboutsummaryrefslogtreecommitdiff
path: root/bin/z
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-12-16 19:50:28 -0300
committerEuAndreh <eu@euandre.org>2022-12-16 19:50:28 -0300
commitce7ea50a3c9b72760b2f1f8ce8548d1a1d422ed0 (patch)
treefb3f3d4a5b09bb9583d0972cb81871e66b7cb688 /bin/z
parentetc/sh/rc: Add _POSIX_C_SOURCE to $CFLAGS by default (diff)
downloaddotfiles-ce7ea50a3c9b72760b2f1f8ce8548d1a1d422ed0.tar.gz
dotfiles-ce7ea50a3c9b72760b2f1f8ce8548d1a1d422ed0.tar.xz
bin/z: Use $TMPDIR: allow z(1) to work on non-writable directories
Diffstat (limited to 'bin/z')
-rwxr-xr-xbin/z3
1 files changed, 1 insertions, 2 deletions
diff --git a/bin/z b/bin/z
index 0558436..30ce8ce 100755
--- a/bin/z
+++ b/bin/z
@@ -95,8 +95,7 @@ sub arg_for($arg) {
my $type = trim `file -i $_`;
if (any { $type eq $_ } keys %TYPES) {
- my $template = File::Basename::basename $arg . '.XXXXXX';
- my ($fh, $tmpname) = File::Temp::tempfile(TEMPLATE => $template);
+ my ($fh, $tmpname) = File::Temp::tempfile();
push @tmpfiles, $tmpname;
my @command = @{$TYPES{$type}};
print $fh `@command $arg`;