]> git.plutz.net Git - shellwiki/commitdiff
avoid errors from empty event set
authorPaul Hänsch <paul@plutz.net>
Tue, 6 Feb 2024 14:48:06 +0000 (15:48 +0100)
committerPaul Hänsch <paul@plutz.net>
Tue, 6 Feb 2024 14:48:06 +0000 (15:48 +0100)
macros/calendar

index 5a486756537b452d6e53143dff2223bbef2215c6..a8f8dd649019e4b38daf8ab8e73b374684d47745 100755 (executable)
@@ -291,7 +291,7 @@ cal_month() {
     printf '<td><label>%02i</label>' "$dcal"
 
     evlist="$(
-      printf %s\\n "$events" \
+      printf %s "${events}${events:+${BR}}" \
       | while read start end title link; do
         if [ "$((start / 86400))" -lt "$((dcnt / 86400))" -a "$end" -gt "$dcnt" ]; then
           printf '<li><a href="%s\#%s">%s</a></li>' \