From: Urban Wallasch Date: Tue, 6 Jul 2021 16:50:17 +0000 (+0200) Subject: * Fixed bash escaping of single quote characters inside single quoted strings. X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=HEAD;p=imgdupe.git * Fixed bash escaping of single quote characters inside single quoted strings. --- diff --git a/main.c b/main.c index 6677ab1..ddd78e0 100644 --- a/main.c +++ b/main.c @@ -152,8 +152,9 @@ static int find_dupes_cb(db_entry_t *dupes) { for ( const char *cp = p->fname; '\0' != *cp; ++cp ) { /* escape single quotes in file names */ if ( '\'' == *cp ) - putchar('\\'); - putchar(*cp); + printf("'\\''"); + else + putchar(*cp); } putchar('\''); }