From b7e10dccb9e93d6c4785519c30bdfcb9406742d5 Mon Sep 17 00:00:00 2001
From: Jacob Babor <jacob@babor.tech>
Date: Sun, 1 Dec 2024 23:18:55 -0600
Subject: [PATCH] Fix reading empty lines I'm pretty sure shadow(5) guarantees
 this won't happen but best to be safe

---
 wayblue-fix-89.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/wayblue-fix-89.sh b/wayblue-fix-89.sh
index 667de44..b2408a2 100755
--- a/wayblue-fix-89.sh
+++ b/wayblue-fix-89.sh
@@ -43,6 +43,9 @@ for file in /etc/shadow /etc/gshadow; do
 	echo "Parsing $file for junk"
 	# Read each line in the file to iterate over it
 	while read line; do
+		# This should never happen, but if for some reason we get an empty line,
+		# continue
+		[ -z "$line" ] && continue
 		# Per shadow(5), we are guaranteed that all characters leading up to the
 		# first colon are the user's/group's name. To that end, we'll do a bash
 		# string substitution to extract that first column.