bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] maint.mk: use more readable (yet functionally equivalent) quotin


From: Jim Meyering
Subject: [PATCH] maint.mk: use more readable (yet functionally equivalent) quoting
Date: Sat, 28 Jan 2012 10:17:05 +0100

FYI,

>From e55b2563934c2d4b9c20c0d678a922e871aa25f8 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 28 Jan 2012 10:16:25 +0100
Subject: [PATCH] maint.mk: use more readable (yet functionally equivalent)
 quoting

It is common to quote a single quote in a single quoted string like
this:  '...'\''...'.  Unless you know the idiom, that looks like
gibberish, so prefer to double-quote the string when possible.
Then you can use a more readable, lone single quote: "...'..."
* top/maint.mk (sc_cast_of_argument_to_free): Quoting like this
"don't" is more readable than the equivalent 'don'\''t'.
(sc_cast_of_x_alloc_return_value): Likewise.
(sc_cast_of_alloca_return_value): Likewise.
(sc_makefile_path_separator_check): Similar: use ":" in '...',
rather than '\'':'\''.
---
 ChangeLog    |   14 ++++++++++++++
 top/maint.mk |    8 ++++----
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b5fd92e..d37f933 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2012-01-28  Jim Meyering  <address@hidden>
+
+       maint.mk: use more readable (yet functionally equivalent) quoting
+       It is common to quote a single quote in a single quoted string like
+       this:  '...'\''...'.  Unless you know the idiom, that looks like
+       gibberish, so prefer to double-quote the string when possible.
+       Then you can use a more readable, lone single quote: "...'..."
+       * top/maint.mk (sc_cast_of_argument_to_free): Quoting like this
+       "don't" is more readable than the equivalent 'don'\''t'.
+       (sc_cast_of_x_alloc_return_value): Likewise.
+       (sc_cast_of_alloca_return_value): Likewise.
+       (sc_makefile_path_separator_check): Similar: use ":" in '...',
+       rather than '\'':'\''.
+
 2012-01-27  Paul Eggert  <address@hidden>

        stdalign: relax _Alignof and tighten _Alignas test
diff --git a/top/maint.mk b/top/maint.mk
index 2668655..5a23185 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -276,17 +276,17 @@ sc_avoid_if_before_free:
            exit 1; } || :

 sc_cast_of_argument_to_free:
-       @prohibit='\<free *\( *\(' halt='don'\''t cast free argument'   \
+       @prohibit='\<free *\( *\(' halt="don't cast free argument"      \
          $(_sc_search_regexp)

 sc_cast_of_x_alloc_return_value:
        @prohibit='\*\) *x(m|c|re)alloc\>'                              \
-       halt='don'\''t cast x*alloc return value'                       \
+       halt="don't cast x*alloc return value"                          \
          $(_sc_search_regexp)

 sc_cast_of_alloca_return_value:
        @prohibit='\*\) *alloca\>'                                      \
-       halt='don'\''t cast alloca return value'                        \
+       halt="don't cast alloca return value"                           \
          $(_sc_search_regexp)

 sc_space_tab:
@@ -1079,7 +1079,7 @@ sc_po_check:
 # Sometimes it is useful to change the PATH environment variable
 # in Makefiles.  When doing so, it's better not to use the Unix-centric
 # path separator of ':', but rather the automake-provided '$(PATH_SEPARATOR)'.
-msg = '$(ME): Do not use '\'':'\'' above; use $$(PATH_SEPARATOR) instead'
+msg = '$(ME): Do not use ":" above; use $$(PATH_SEPARATOR) instead'
 sc_makefile_path_separator_check:
        @prohibit='PATH[=].*:'                                          \
        in_vc_files='akefile|\.mk$$'                                    \
--
1.7.9.1.g63eb



reply via email to

[Prev in Thread] Current Thread [Next in Thread]