Skip to content

Commit fc463fe

Browse files
committed
properly escape \e and \s
Signed-off-by: Zen <[email protected]>
1 parent c2923b0 commit fc463fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ugrd/base/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def readvar(self) -> str:
179179
def check_var(self) -> str:
180180
"""Returns a bash function that checks the value of a variable.
181181
if it's not set, tries to read the cmdline."""
182-
return """
182+
return r"""
183183
if [ -z "$(readvar "$1")" ]; then # preferably the variable is set, because this is slower
184184
cmdline=$(awk -F '--' '{print $1}' /proc/cmdline) # Get everything before '--'
185185
if grep -qE "(^|\s)$1(\s|$)" <<< "$cmdline"; then
@@ -259,7 +259,7 @@ def klog(self) -> str:
259259
# To feel more at home
260260
def edebug(self) -> str:
261261
"""Returns a bash function like edebug."""
262-
return """
262+
return r"""
263263
if check_var quiet; then
264264
return
265265
fi

0 commit comments

Comments
 (0)