~delthas/senpai-dev

Fix literal backslash in sed command in scdoc v1 PROPOSED

Lukas Schmelting: 1
 Fix literal backslash in sed command in scdoc

 1 files changed, 1 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~delthas/senpai-dev/patches/56733/mbox | git am -3
Learn more about email & git

[PATCH] Fix literal backslash in sed command in scdoc Export this patch

A literal backslash in a sed command needs to be escaped using a double
backslash. Furthermore, a backslash in literal text in scdoc needs to
also be escaped. In consequence, a literal backlash in a sed command in
scdoc needs to be written as 4 backslashes.

Signed-off-by: Lukas Schmelting <lschmelting@posteo.com>
---
 doc/senpai.5.scd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/senpai.5.scd b/doc/senpai.5.scd
index 42a2375..ff54c7f 100644
--- a/doc/senpai.5.scd
+++ b/doc/senpai.5.scd
@@ -249,7 +249,7 @@ And the highlight file (*~/.config/senpai/highlight*):
#!/bin/sh

escape() {
	printf "%s" "$1" | sed 's#\\#\\\\#g'
	printf "%s" "$1" | sed 's#\\\\#\\\\\\\\#g'
}
FOCUS=$(swaymsg -t get_tree | jq '..|objects|select(.focused==true)|.name' | grep senpai | wc -l)
if [ "$HERE" -eq 0 ] || [ $FOCUS -eq 0 ]; then
-- 
2.47.1