[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Miscellaneous code readability improvements.
From: |
Joel E. Denny |
Subject: |
Re: [PATCH] Miscellaneous code readability improvements. |
Date: |
Fri, 21 Aug 2009 20:43:35 -0400 (EDT) |
User-agent: |
Alpine 1.00 (DEB 882 2007-12-20) |
On Wed, 19 Aug 2009, Joel E. Denny wrote:
> diff --git a/src/scan-gram.l b/src/scan-gram.l
> @@ -616,8 +617,12 @@ splice (\\[ \f\t\v]*\n)*
> }
> \\(.|\n) {
> char const *p = yytext + 1;
> - if (*p == ' ')
> - p = "` '";
> + char quoted_ws[] = "` '";
> + if (isspace (*p) && isprint (*p))
> + {
> + quoted_ws[1] = *p;
> + p = quoted_ws;
> + }
> else
> p = quotearg_style_mem (escape_quoting_style, p, 1);
> complain_at (*loc, _("invalid character after \\-escape: %s"), p);
I pushed the following to master, branch-2.5, and branch-2.4.2.
>From e6c849d82a95be8a595c254cc3046cfae725f064 Mon Sep 17 00:00:00 2001
From: Joel E. Denny <address@hidden>
Date: Fri, 21 Aug 2009 20:09:54 -0400
Subject: [PATCH] Use locale when quoting.
* src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
quote rather than implementing quoting here.
---
ChangeLog | 6 ++++++
src/scan-gram.l | 7 ++-----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 33d806f..b831d11 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-08-21 Joel E. Denny <address@hidden>
+
+ Use locale when quoting.
+ * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
+ quote rather than implementing quoting here.
+
2009-08-20 Eric Blake <address@hidden>
Make previous patch more robust.
diff --git a/src/scan-gram.l b/src/scan-gram.l
index 4ed30c6..93e0d10 100644
--- a/src/scan-gram.l
+++ b/src/scan-gram.l
@@ -617,12 +617,9 @@ splice (\\[ \f\t\v]*\n)*
}
\\(.|\n) {
char const *p = yytext + 1;
- char quoted_ws[] = "` '";
+ /* Quote only if escaping won't make the character visible. */
if (isspace (*p) && isprint (*p))
- {
- quoted_ws[1] = *p;
- p = quoted_ws;
- }
+ p = quote (p);
else
p = quotearg_style_mem (escape_quoting_style, p, 1);
complain_at (*loc, _("invalid character after \\-escape: %s"), p);
--
1.5.4.3
- Re: [PATCH] Miscellaneous code readability improvements., (continued)
- Re: [PATCH] Miscellaneous code readability improvements., Akim Demaille, 2009/08/12
- Re: [PATCH] Miscellaneous code readability improvements., Joel E. Denny, 2009/08/13
- Re: [PATCH] Miscellaneous code readability improvements., Akim Demaille, 2009/08/13
- Re: [PATCH] Miscellaneous code readability improvements., Joel E. Denny, 2009/08/13
- Re: [PATCH] Miscellaneous code readability improvements., Akim Demaille, 2009/08/13
- Re: [PATCH] Miscellaneous code readability improvements., Akim Demaille, 2009/08/14
- Re: [PATCH] Miscellaneous code readability improvements., Joel E. Denny, 2009/08/18
- Re: [PATCH] Miscellaneous code readability improvements., Joel E. Denny, 2009/08/19
- Re: [PATCH] Miscellaneous code readability improvements., Akim Demaille, 2009/08/19
- Re: [PATCH] Miscellaneous code readability improvements., Joel E. Denny, 2009/08/19
- Re: [PATCH] Miscellaneous code readability improvements.,
Joel E. Denny <=
- Re: [PATCH] Miscellaneous code readability improvements., Eric Blake, 2009/08/27
- Re: [PATCH] Miscellaneous code readability improvements., Joel E. Denny, 2009/08/27
- Re: [PATCH] Miscellaneous code readability improvements., Eric Blake, 2009/08/27
- Re: [PATCH] Miscellaneous code readability improvements., Joel E. Denny, 2009/08/27
- Re: [PATCH] Miscellaneous code readability improvements., Eric Blake, 2009/08/27
- Re: [PATCH] Miscellaneous code readability improvements., Joel E. Denny, 2009/08/28
- Re: [PATCH] Miscellaneous code readability improvements., Eric Blake, 2009/08/28
- Re: [PATCH] Miscellaneous code readability improvements., Joel E. Denny, 2009/08/29