Skip to content

Commit

Permalink
propagate file extension to newly created temporary files
Browse files Browse the repository at this point in the history
  • Loading branch information
wofr06 committed Jan 28, 2024
1 parent ef94a6c commit 41b6334
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
****************************************************************************
# ChangeLog for lesspipe.sh #
****************************************************************************
- propagate file extension to newly created temporary files
- use again csvlook for display of csv files if available
- use csvtable for tabular display of csv files, needs Text::CSV from perl
Version 2.11 Dec 13 2023
Expand Down
4 changes: 2 additions & 2 deletions lesspipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ filetype () {
declare t
t=$(nexttmp)
head -c 1000000 > "$t" 2>/dev/null
[[ -z $fileext ]] && fname="$t" || fname="$fileext"
set "$t" "$2"
fname="$fileext"
fi
fext=$(fileext "$fname")
### get file type from mime type
Expand Down Expand Up @@ -182,7 +182,7 @@ separatorline () {
}

nexttmp () {
declare new="$tmpdir/lesspipe.$RANDOM"
declare new="$tmpdir/lesspipe.$RANDOM.${ft%%:*}"
echo "$new"
}

Expand Down

0 comments on commit 41b6334

Please sign in to comment.