From 038a24297765890afd349f64f3eb5951fae96e5c Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Thu, 5 Dec 2019 22:02:27 +0100 Subject: print_shquoted: fast-path for unescaped file name output --- lr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lr.c b/lr.c index ffd4ca3..228766d 100644 --- a/lr.c +++ b/lr.c @@ -1714,6 +1714,12 @@ print_shquoted(const char *s) const char *t; int esc = 0; + + if (!Qflag) { + printf("%s", s); + return; + } + for (t = s; *t; ) { if ((unsigned char)*t <= 32 || strchr("`^#*[]=|\\?${}()'\"<>&;\177", *t)) { @@ -1728,7 +1734,7 @@ print_shquoted(const char *s) } } - if (!Qflag || !esc) { + if (!esc) { printf("%s", s); return; } -- cgit 1.4.1