about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lr.c8
1 files changed, 7 insertions, 1 deletions
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;
 	}