aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@firemail.cc>2023-08-05 19:21:27 +0530
committersinanmohd <sinan@firemail.cc>2023-08-06 11:21:06 +0530
commite6188bb8d98574669d5d7f7a7d4c6aa595aeaacf (patch)
tree89321a97d366a9ef76a979b009cffd0ce51b559a
parent1d4994d432cca227730ed97a54b755be1954accc (diff)
damb: invalidate values with newline character
-rwxr-xr-xdamb6
1 files changed, 5 insertions, 1 deletions
diff --git a/damb b/damb
index 96d6bab..612619c 100755
--- a/damb
+++ b/damb
@@ -152,6 +152,10 @@ verify_val()
{
# verify_val <value>
+ case "$1" in
+ *"\n"*) return 1 ;;
+ esac
+
case "$(file --brief --dereference --mime-type "$1")" in
audio/*|video/*) ;;
*)
@@ -216,7 +220,7 @@ set_clip()
{
if [ -n "$WAYLAND_DISPLAY" ]; then
dep_check "wl-paste"
- _clip="$(wl-paste)"
+ _clip="$(wl-paste -n)"
elif [ -n "$DISPLAY" ]; then
dep_check "xclip"
_clip="$(xclip -o)"