commit 35521af0ecf0f76bd76a9be4042a5449efb5cbc1
parent d5a94491719c175cac5c75bc6fe4b3884eac9d21
Author: Chris Down <chris@chrisdown.name>
Date: Mon, 27 Jul 2015 19:58:05 -0700
Make sure that the clipboard data is not just whitespace before copying
This avoids getting a bad array subscript, and polluting the menu.
Thanks to @kaihendry for noticing this issue and suggesting a fix. This commit
is a modified version of his suggestion, using [:blank:] instead of [:space:].
Closes #7.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clipmenud b/clipmenud
@@ -15,7 +15,7 @@ while sleep 1; do
data=${data%x}
- [[ $data ]] || continue
+ [[ $data == *[^[:blank:]]* ]] || continue
[[ ${last_data[$selection]} == "$data" ]] && continue
last_data[$selection]=$data