File: fix_display-dhammapada.patch

package info (click to toggle)
display-dhammapada 2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 432 kB
  • sloc: perl: 1,564; sh: 196; makefile: 11
file content (24 lines) | stat: -rw-r--r-- 924 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: Fix typos and improve AWK provider compatibility
 - Fix non-standard regular expression.
 - Fix spelling errors(6erse -> verse).
Author: Haolin Xue <tzbkk@outlook.com>
Forwarded: no
Last-Update: 2026-02-22
Index: display-dhammapada/usr/local/bin/display-dhammapada
===================================================================
--- display-dhammapada.orig/usr/local/bin/display-dhammapada	2026-02-22 00:40:25.134280693 +0800
+++ display-dhammapada/usr/local/bin/display-dhammapada	2026-02-22 00:41:11.886275074 +0800
@@ -118,11 +118,11 @@ local A_PATH="/usr/share/display-dhammap
 	esac
 	fi
 	if [[ "$1" == 1 || "$2" == 1 ]] ; then printf "\n"; fi
-"$GAWK" -v RS=% -v num="$verse" '$0 ~ "\\<" num "\\>"' "$F_PATH"/"$TRANS"
+"$GAWK" -v RS=% -v num="$verse" '$0 ~ "(^|[[:space:]])"num"([[:space:]]|$)"' "$F_PATH"/"$TRANS"
 }
 
 if [[ -z "$2@" ]] ; then
-	6erse "$1"
+	verse "$1"
 else
 	verse "$1" "$2"
 fi