Skip to content

Fix clipdel escaped only first '#'#95

Merged
cdown merged 1 commit into
cdown:developfrom
Gravemind:fix-clipdel-escape
Nov 12, 2018
Merged

Fix clipdel escaped only first '#'#95
cdown merged 1 commit into
cdown:developfrom
Gravemind:fix-clipdel-escape

Conversation

@Gravemind

Copy link
Copy Markdown
Contributor

Clipdel only escapes the first '#'. Repro steps:

  • copy and run clipdel '#foo#', you get:

    sed: -e expression #1, char 9: comments don't accept any addresses
    

This PR fix this by using bash expansion subtlety, from bash reference:

${parameter/pattern/string}
... If pattern begins with ‘/’, all matches of pattern are replaced with string...

Now escapes all occurrences of '#' in clipdel pattern.
@cdown

cdown commented Nov 12, 2018

Copy link
Copy Markdown
Owner

Well, that's a fuckup. Thanks!

@cdown

cdown commented Nov 12, 2018

Copy link
Copy Markdown
Owner

(in general I hope #78 will help find these faster in future)

@cdown cdown merged commit ec86549 into cdown:develop Nov 12, 2018
@Gravemind Gravemind deleted the fix-clipdel-escape branch November 12, 2018 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants