Skip to content

Commit fc9e594

Browse files
committed
Fix htdecodetoken to work with token files that do not end in a newline
1 parent e777edb commit fc9e594

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

htdecodetoken

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ if [ -n "$TOKENFILE" ]; then
109109
echo "$TOKENFILE not found" >&2
110110
exit 1
111111
fi
112-
read TOKEN <$TOKENFILE
112+
# the -n is needed here for when there is no ending newline in the file
113+
read TOKEN <$TOKENFILE || [ -n "$TOKEN" ]
113114
fi
114115
if [ -z "$TOKEN" ]; then
115116
echo "Token is empty" >&2

htgettoken.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ rm -rf $RPM_BUILD_ROOT
8080

8181

8282
%changelog
83+
# - Fix htdecodetoken to work with token files that do not end in a newline.
84+
8385
* Thu Jul 25 2024 Dave Dykstra <[email protected]> 2.0-2
8486
- Fix broken httokendecode symlink.
8587
- Use python wheels to build/install on el9. It didn't work on el8 so

0 commit comments

Comments
 (0)