aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2016-11-27 20:38:14 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2016-11-27 20:38:14 +0000
commit350fcdd5dff1d44ab729983847fcc3d8ff0e6362 (patch)
treea64e9217b89a204010fcd04041577e98679d855e /usr.bin
parent6daffe6ebf8ac89699787b7a6598bfafc41b7eed (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/indent/indent.c10
-rw-r--r--usr.bin/indent/indent_codes.h1
-rw-r--r--usr.bin/indent/lexi.c5
3 files changed, 16 insertions, 0 deletions
diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c
index 03e649facfb6a..668702bb5d6c5 100644
--- a/usr.bin/indent/indent.c
+++ b/usr.bin/indent/indent.c
@@ -1004,6 +1004,16 @@ check_type:
ps.want_blank = true;
break;
+ case strpfx:
+ if (ps.want_blank)
+ *e_code++ = ' ';
+ for (t_ptr = token; *t_ptr; ++t_ptr) {
+ CHECK_SIZE_CODE;
+ *e_code++ = *t_ptr;
+ }
+ ps.want_blank = false;
+ break;
+
case period: /* treat a period kind of like a binary
* operation */
*e_code++ = '.'; /* move the period into line */
diff --git a/usr.bin/indent/indent_codes.h b/usr.bin/indent/indent_codes.h
index cfe4b7fa1814f..db5b325f7a63f 100644
--- a/usr.bin/indent/indent_codes.h
+++ b/usr.bin/indent/indent_codes.h
@@ -68,3 +68,4 @@
#define ifhead 30
#define elsehead 31
#define period 32
+#define strpfx 33
diff --git a/usr.bin/indent/lexi.c b/usr.bin/indent/lexi.c
index f48de32155478..14de65acd5a6f 100644
--- a/usr.bin/indent/lexi.c
+++ b/usr.bin/indent/lexi.c
@@ -237,6 +237,11 @@ lexi(void)
fill_buffer();
}
*e_token++ = '\0';
+
+ if (s_token[0] == 'L' && s_token[1] == '\0' &&
+ (*buf_ptr == '"' || *buf_ptr == '\''))
+ return (strpfx);
+
while (*buf_ptr == ' ' || *buf_ptr == '\t') { /* get rid of blanks */
if (++buf_ptr >= buf_end)
fill_buffer();