bug-gnulib
[Top][All Lists]
Advanced

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

Re: quotearg: implement custom_quoting_style


From: Joel E. Denny
Subject: Re: quotearg: implement custom_quoting_style
Date: Sun, 23 Aug 2009 16:29:24 -0400 (EDT)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

On Sun, 23 Aug 2009, Joel E. Denny wrote:

> On Sun, 23 Aug 2009, Bruno Haible wrote:

> >   - Can you please avoid 1-letter identifiers as function parameters?
> >     'l' and 'r', in particular. At the first glance, I thought it would
> >     be possible to set l = "[(" and r = "])".
> 
> Why isn't that possible?
> 
>   quotearg_custom ("[(", "])", "[(joel's])\tstring");
> 
> produces
> 
>   "[([(joel's\\])\\tstring])"
> 
> Is that not what you expect, or did I miss your point?

It occurs to me now that you might be thinking of multiple levels of 
quotes.  In the patch below, I've added some documentation and tests to 
clarify that issue.

> >     Can you call them
> >     'left_quote' and 'right_quote', respectively? That would avoid this
> >     misunderstanding.
> 
> Regardless of the above rationale, I agree with the better names.

> >   - The 'if (quoting_style != custom_quoting_style) {' code should be
> >     moved to before the big 'TRANSLATORS:' comment. You know that
> >     this comment is meant to be extracted by xgettext, and xgettext
> >     extracts it only if there is no other non-empty line between the
> >     comment and the gettext() invocation.
> 
> I really need to study internationalization more.  I'll fix it.  Thanks.

> > > +    /* Like c_quoting_style except use the custom quotation marks set by
> > > +       set_custom_quoting.
> > 
> > This should be "Like clocale_quoting_style", not "Like c_quoting_style":
> > Because c_quoting_style also handles trigraphs, which custom_quoting_style
> > doesn't.
> 
> I missed that.  I copied those comments from the comments on 
> clocale_quoting_style, which don't mention the trigraph distinction.  
> I'll fix that too.

All fixed below.

Ok to push the previous 4 patches followed by the one below?

>From 679e129dc90a47399dca965e2ebd6a728554c118 Mon Sep 17 00:00:00 2001
From: Joel E. Denny <address@hidden>
Date: Sun, 23 Aug 2009 14:28:11 -0400
Subject: [PATCH] quotearg: adjust recent custom_quoting_style commit

* lib/quotearg.c: Rename l, left, r, and right to left_quote and
right_quote throughout.
* lib/quotearg.h: Likewise.
* tests/test-quotearg.c: Likewise.
* lib/quotearg.c (quotearg_buffer_restyled): Move comments for
the translators back to immediately before the N_ invocations.
* lib/quotearg.h (enum quoting_style): For escape_quoting_style
and clocale_quoting_style, comment that QA_SPLIT_TRIGRAPHS is
ignored even though they're otherwise like c_quoting_style.  For
the same reason, comment that custom_quoting_style is like
clocale_quoting_style not c_quoting_style.  Also, add another
custom_quoting_style example explaining multilevel quotes.
* tests/test-quotearg.c (custom_quotes): Fix example that was
supposed to test that a special character at the beginning of
right_quote is not doubly escaped (the full right quote never
actually appeared in the input).  Add multilevel quote test.
(custom_results): Update.
Reported by Bruno Haible.
---
 ChangeLog             |   22 ++++++++++
 lib/quotearg.c        |  102 ++++++++++++++++++++++++++----------------------
 lib/quotearg.h        |   76 +++++++++++++++++++++++-------------
 tests/test-quotearg.c |   44 +++++++++++++--------
 4 files changed, 154 insertions(+), 90 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 42b96f4..faae991 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2009-08-23  Joel E. Denny  <address@hidden>
+
+       quotearg: adjust recent custom_quoting_style commit
+       * lib/quotearg.c: Rename l, left, r, and right to left_quote and
+       right_quote throughout.
+       * lib/quotearg.h: Likewise.
+       * tests/test-quotearg.c: Likewise.
+       * lib/quotearg.c (quotearg_buffer_restyled): Move comments for
+       the translators back to immediately before the N_ invocations.
+       * lib/quotearg.h (enum quoting_style): For escape_quoting_style
+       and clocale_quoting_style, comment that QA_SPLIT_TRIGRAPHS is
+       ignored even though they're otherwise like c_quoting_style.  For
+       the same reason, comment that custom_quoting_style is like
+       clocale_quoting_style not c_quoting_style.  Also, add another
+       custom_quoting_style example explaining multilevel quotes.
+       * tests/test-quotearg.c (custom_quotes): Fix example that was
+       supposed to test that a special character at the beginning of
+       right_quote is not doubly escaped (the full right quote never
+       actually appeared in the input).  Add multilevel quote test.
+       (custom_results): Update.
+       Reported by Bruno Haible.
+
 2009-08-22  Joel E. Denny  <address@hidden>
 
        quotearg: document limitations of quote_these_too
diff --git a/lib/quotearg.c b/lib/quotearg.c
index 0c11a62..8380e9d 100644
--- a/lib/quotearg.c
+++ b/lib/quotearg.c
@@ -56,10 +56,10 @@ struct quoting_options
   unsigned int quote_these_too[(UCHAR_MAX / INT_BITS) + 1];
 
   /* The left quote for custom_quoting_style.  */
-  char const *left;
+  char const *left_quote;
 
   /* The right quote for custom_quoting_style.  */
-  char const *right;
+  char const *right_quote;
 };
 
 /* Names of quoting styles.  */
@@ -154,15 +154,15 @@ set_quoting_flags (struct quoting_options *o, int i)
 
 void
 set_custom_quoting (struct quoting_options *o,
-                    char const *l, char const *r)
+                    char const *left_quote, char const *right_quote)
 {
   if (!o)
     o = &default_quoting_options;
   o->style = custom_quoting_style;
-  if (!l || !r)
+  if (!left_quote || !right_quote)
     abort ();
-  o->left = l;
-  o->right = r;
+  o->left_quote = left_quote;
+  o->right_quote = right_quote;
 }
 
 /* Return quoting options for STYLE, with no extra quoting.  */
@@ -205,7 +205,8 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
                          char const *arg, size_t argsize,
                          enum quoting_style quoting_style, int flags,
                          unsigned int const *quote_these_too,
-                         char const *left, char const *right)
+                         char const *left_quote,
+                         char const *right_quote)
 {
   size_t i;
   size_t len = 0;
@@ -247,36 +248,35 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
     case clocale_quoting_style:
     case custom_quoting_style:
       {
-       /* TRANSLATORS:
-          Get translations for open and closing quotation marks.
-
-          The message catalog should translate "`" to a left
-          quotation mark suitable for the locale, and similarly for
-          "'".  If the catalog has no translation,
-          locale_quoting_style quotes `like this', and
-          clocale_quoting_style quotes "like this".
-
-          For example, an American English Unicode locale should
-          translate "`" to U+201C (LEFT DOUBLE QUOTATION MARK), and
-          should translate "'" to U+201D (RIGHT DOUBLE QUOTATION
-          MARK).  A British English Unicode locale should instead
-          translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and
-          U+2019 (RIGHT SINGLE QUOTATION MARK), respectively.
-
-          If you don't know what to put here, please see
-          <http://en.wikipedia.org/wiki/Quotation_mark#Glyphs>
-          and use glyphs suitable for your language.  */
-
        if (quoting_style != custom_quoting_style)
          {
-           left = gettext_quote (N_("`"), quoting_style);
-           right = gettext_quote (N_("'"), quoting_style);
+           /* TRANSLATORS:
+              Get translations for open and closing quotation marks.
+
+              The message catalog should translate "`" to a left
+              quotation mark suitable for the locale, and similarly for
+              "'".  If the catalog has no translation,
+              locale_quoting_style quotes `like this', and
+              clocale_quoting_style quotes "like this".
+
+              For example, an American English Unicode locale should
+              translate "`" to U+201C (LEFT DOUBLE QUOTATION MARK), and
+              should translate "'" to U+201D (RIGHT DOUBLE QUOTATION
+              MARK).  A British English Unicode locale should instead
+              translate these to U+2018 (LEFT SINGLE QUOTATION MARK)
+              and U+2019 (RIGHT SINGLE QUOTATION MARK), respectively.
+
+              If you don't know what to put here, please see
+              <http://en.wikipedia.org/wiki/Quotation_mark#Glyphs>
+              and use glyphs suitable for your language.  */
+           left_quote = gettext_quote (N_("`"), quoting_style);
+           right_quote = gettext_quote (N_("'"), quoting_style);
          }
        if (!elide_outer_quotes)
-         for (quote_string = left; *quote_string; quote_string++)
+         for (quote_string = left_quote; *quote_string; quote_string++)
            STORE (*quote_string);
        backslash_escapes = true;
-       quote_string = right;
+       quote_string = right_quote;
        quote_string_len = strlen (quote_string);
       }
       break;
@@ -612,7 +612,7 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
   return quotearg_buffer_restyled (buffer, buffersize, arg, argsize,
                                   quoting_style,
                                   flags & ~QA_ELIDE_OUTER_QUOTES, NULL,
-                                  left, right);
+                                  left_quote, right_quote);
 }
 
 /* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
@@ -633,7 +633,7 @@ quotearg_buffer (char *buffer, size_t buffersize,
   int e = errno;
   size_t r = quotearg_buffer_restyled (buffer, buffersize, arg, argsize,
                                       p->style, p->flags, p->quote_these_too,
-                                      p->left, p->right);
+                                      p->left_quote, p->right_quote);
   errno = e;
   return r;
 }
@@ -662,10 +662,12 @@ quotearg_alloc_mem (char const *arg, size_t argsize, 
size_t *size,
   int flags = p->flags | (size ? 0 : QA_ELIDE_NULL_BYTES);
   size_t bufsize = quotearg_buffer_restyled (0, 0, arg, argsize, p->style,
                                             flags, p->quote_these_too,
-                                            p->left, p->right) + 1;
+                                            p->left_quote,
+                                            p->right_quote) + 1;
   char *buf = xcharalloc (bufsize);
   quotearg_buffer_restyled (buf, bufsize, arg, argsize, p->style, flags,
-                           p->quote_these_too, p->left, p->right);
+                           p->quote_these_too,
+                           p->left_quote, p->right_quote);
   errno = e;
   if (size)
     *size = bufsize - 1;
@@ -755,8 +757,8 @@ quotearg_n_options (int n, char const *arg, size_t argsize,
     size_t qsize = quotearg_buffer_restyled (val, size, arg, argsize,
                                             options->style, flags,
                                             options->quote_these_too,
-                                            options->left,
-                                            options->right);
+                                            options->left_quote,
+                                            options->right_quote);
 
     if (size <= qsize)
       {
@@ -766,7 +768,8 @@ quotearg_n_options (int n, char const *arg, size_t argsize,
        sv[n].val = val = xcharalloc (size);
        quotearg_buffer_restyled (val, size, arg, argsize, options->style,
                                  flags, options->quote_these_too,
-                                 options->left, options->right);
+                                 options->left_quote,
+                                 options->right_quote);
       }
 
     errno = e;
@@ -853,29 +856,34 @@ quotearg_colon_mem (char const *arg, size_t argsize)
 }
 
 char *
-quotearg_n_custom (int n, char const *l, char const *r, char const *arg)
+quotearg_n_custom (int n, char const *left_quote,
+                  char const *right_quote, char const *arg)
 {
-  return quotearg_n_custom_mem (n, l, r, arg, SIZE_MAX);
+  return quotearg_n_custom_mem (n, left_quote, right_quote, arg,
+                               SIZE_MAX);
 }
 
 char *
-quotearg_n_custom_mem (int n, char const *l, char const *r,
+quotearg_n_custom_mem (int n, char const *left_quote,
+                      char const *right_quote,
                       char const *arg, size_t argsize)
 {
   struct quoting_options o = default_quoting_options;
-  set_custom_quoting (&o, l, r);
+  set_custom_quoting (&o, left_quote, right_quote);
   return quotearg_n_options (n, arg, argsize, &o);
 }
 
 char *
-quotearg_custom (char const *l, char const *r, char const *arg)
+quotearg_custom (char const *left_quote, char const *right_quote,
+                char const *arg)
 {
-  return quotearg_n_custom (0, l, r, arg);
+  return quotearg_n_custom (0, left_quote, right_quote, arg);
 }
 
 char *
-quotearg_custom_mem (char const *l, char const *r, char const *arg,
-                    size_t argsize)
+quotearg_custom_mem (char const *left_quote, char const *right_quote,
+                    char const *arg, size_t argsize)
 {
-  return quotearg_n_custom_mem (0, l, r, arg, argsize);
+  return quotearg_n_custom_mem (0, left_quote, right_quote, arg,
+                               argsize);
 }
diff --git a/lib/quotearg.h b/lib/quotearg.h
index 0701d73..63c47f1 100644
--- a/lib/quotearg.h
+++ b/lib/quotearg.h
@@ -100,7 +100,8 @@ enum quoting_style
     c_maybe_quoting_style,
 
     /* Like c_quoting_style except always omit the surrounding
-       double-quote characters (ls --quoting-style=escape).
+       double-quote characters and ignore QA_SPLIT_TRIGRAPHS
+       (ls --quoting-style=escape).
 
        quotearg_buffer:
        "simple", "\\0 \\t\\n'\"\\033??/\\\\", "a:b"
@@ -136,7 +137,8 @@ enum quoting_style
     locale_quoting_style,
 
     /* Like c_quoting_style except use quotation marks appropriate for
-       the locale (ls --quoting-style=clocale).
+       the locale and ignore QA_SPLIT_TRIGRAPHS
+       (ls --quoting-style=clocale).
 
        LC_MESSAGES=C
        quotearg_buffer:
@@ -159,11 +161,11 @@ enum quoting_style
     */
     clocale_quoting_style,
 
-    /* Like c_quoting_style except use the custom quotation marks set by
-       set_custom_quoting.  If custom quotation marks are not set, the
-       behavior is undefined.
+    /* Like clocale_quoting_style except use the custom quotation marks
+       set by set_custom_quoting.  If custom quotation marks are not
+       set, the behavior is undefined.
 
-       left = right = "'"
+       left_quote = right_quote = "'"
        quotearg_buffer:
        "'simple'", "'\\0 \\t\\n\\'\"\\033??/\\\\'", "'a:b'"
        quotearg:
@@ -171,7 +173,7 @@ enum quoting_style
        quotearg_colon:
        "'simple'", "'\\0 \\t\\n\\'\"\\033??/\\\\'", "'a\\:b'"
 
-       left = "(" and right = ")"
+       left_quote = "(" and right_quote = ")"
        quotearg_buffer:
        "(simple)", "(\\0 \\t\\n'\"\\033??/\\\\)", "(a:b)"
        quotearg:
@@ -179,13 +181,26 @@ enum quoting_style
        quotearg_colon:
        "(simple)", "(\\0 \\t\\n'\"\\033??/\\\\)", "(a\\:b)"
 
-       left = ":" and right = " "
+       left_quote = ":" and right_quote = " "
        quotearg_buffer:
        ":simple ", ":\\0\\ \\t\\n'\"\\033??/\\\\ ", ":a:b "
        quotearg:
        ":simple ", ":\\0\\ \\t\\n'\"\\033??/\\\\ ", ":a:b "
        quotearg_colon:
        ":simple ", ":\\0\\ \\t\\n'\"\\033??/\\\\ ", ":a\\:b "
+
+       left_quote = "\"'" and right_quote = "'\""
+       Notice that this is treated as a single level of quotes or two
+       levels where the outer quote need not be escaped within the inner
+       quotes.  For two levels where the outer quote must be escaped
+       within the inner quotes, you must use separate quotearg
+       invocations.
+       quotearg_buffer:
+       "\"'simple'\"", "\"'\\0 \\t\\n\\'\"\\033??/\\\\'\"", "\"'a:b'\""
+       quotearg:
+       "\"'simple'\"", "\"'\\0 \\t\\n\\'\"\\033??/\\\\'\"", "\"'a:b'\""
+       quotearg_colon:
+       "\"'simple'\"", "\"'\\0 \\t\\n\\'\"\\033??/\\\\'\"", "\"'a\\:b'\""
     */
     custom_quoting_style
   };
@@ -253,14 +268,16 @@ int set_quoting_flags (struct quoting_options *o, int i);
 
 /* In O (or in the default if O is null),
    set the value of the quoting style to custom_quoting_style,
-   set the left quote to L, and set the right quote to R.
-   Each of L and R must be null-terminated and can be the empty
-   string.  Because backslashes are used for escaping, it does not make
-   sense for R to contain a backslash.  R must not begin with a digit or
-   a letter that has special meaning after a backslash (for example,
-   "\t" for tab).  */
+   set the left quote to LEFT_QUOTE, and set the right quote to
+   RIGHT_QUOTE.  Each of LEFT_QUOTE and RIGHT_QUOTE must be
+   null-terminated and can be the empty string.  Because backslashes are
+   used for escaping, it does not make sense for RIGHT_QUOTE to contain
+   a backslash.  RIGHT_QUOTE must not begin with a digit or a letter
+   that has special meaning after a backslash (for example, "\t" for
+   tab).  */
 void set_custom_quoting (struct quoting_options *o,
-                        char const *l, char const *r);
+                        char const *left_quote,
+                        char const *right_quote);
 
 /* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
    argument ARG (of size ARGSIZE), using O to control quoting.
@@ -344,21 +361,26 @@ char *quotearg_colon (char const *arg);
 char *quotearg_colon_mem (char const *arg, size_t argsize);
 
 /* Like quotearg_n_style (N, S, ARG) but with S as custom_quoting_style
-   with left quote as L and right quote as R.  See set_custom_quoting
-   for a description of acceptable L and R values.  */
-char *quotearg_n_custom (int n, char const *l, char const *r,
-                        char const *arg);
-
-/* Like quotearg_n_custom (N, L, R, ARG) except it can quote null
-   bytes.  */
-char *quotearg_n_custom_mem (int n, char const *l, char const *r,
+   with left quote as LEFT_QUOTE and right quote as RIGHT_QUOTE.  See
+   set_custom_quoting for a description of acceptable LEFT_QUOTE and
+   RIGHT_QUOTE values.  */
+char *quotearg_n_custom (int n, char const *left_quote,
+                        char const *right_quote, char const *arg);
+
+/* Like quotearg_n_custom (N, LEFT_QUOTE, RIGHT_QUOTE, ARG) except it
+   can quote null bytes.  */
+char *quotearg_n_custom_mem (int n, char const *left_quote,
+                            char const *right_quote,
                             char const *arg, size_t argsize);
 
-/* Equivalent to quotearg_n_custom (0, L, R, ARG).  */
-char *quotearg_custom (char const *l, char const *r, char const *arg);
+/* Equivalent to quotearg_n_custom (0, LEFT_QUOTE, RIGHT_QUOTE, ARG).  */
+char *quotearg_custom (char const *left_quote, char const *right_quote,
+                      char const *arg);
 
-/* Equivalent to quotearg_n_custom_mem (0, L, R, ARG, ARGSIZE).  */
-char *quotearg_custom_mem (char const *l, char const *r,
+/* Equivalent to quotearg_n_custom_mem (0, LEFT_QUOTE, RIGHT_QUOTE, ARG,
+                                       ARGSIZE).  */
+char *quotearg_custom_mem (char const *left_quote,
+                          char const *right_quote,
                           char const *arg, size_t argsize);
 
 /* Free any dynamically allocated memory.  */
diff --git a/tests/test-quotearg.c b/tests/test-quotearg.c
index 5a680d9..65779ad 100644
--- a/tests/test-quotearg.c
+++ b/tests/test-quotearg.c
@@ -205,11 +205,12 @@ static char const *custom_quotes[][2] = {
   { "(", ")"  },
   { ":", " "  },
   { " ", ":"  },
-  { "# ", "\n\n" }
+  { "# ", "\n" },
+  { "\"'", "'\"" }
 };
 
 static struct result_groups custom_results[] = {
-  /* left = right = "" */
+  /* left_quote = right_quote = "" */
   { { "", "\\0001\\0", 7, "simple",
       " \\t\\n'\"\\033?""?/\\\\", "a:b", "a\\\\b",
       LQ_ENC RQ_ENC },
@@ -220,7 +221,7 @@ static struct result_groups custom_results[] = {
       " \\t\\n'\"\\033?""?/\\\\", "a\\:b", "a\\\\b",
       LQ_ENC RQ_ENC } },
 
-  /* left = right = "'" */
+  /* left_quote = right_quote = "'" */
   { { "''", "'\\0001\\0'", 9, "'simple'",
       "' \\t\\n\\'\"\\033?""?/\\\\'", "'a:b'", "'a\\\\b'",
       "'" LQ_ENC RQ_ENC "'" },
@@ -231,7 +232,7 @@ static struct result_groups custom_results[] = {
       "' \\t\\n\\'\"\\033?""?/\\\\'", "'a\\:b'", "'a\\\\b'",
       "'" LQ_ENC RQ_ENC "'" } },
 
-  /* left = "(" and right = ")" */
+  /* left_quote = "(" and right_quote = ")" */
   { { "()", "(\\0001\\0)", 9, "(simple)",
       "( \\t\\n'\"\\033?""?/\\\\)", "(a:b)", "(a\\\\b)",
       "(" LQ_ENC RQ_ENC ")" },
@@ -242,7 +243,7 @@ static struct result_groups custom_results[] = {
       "( \\t\\n'\"\\033?""?/\\\\)", "(a\\:b)", "(a\\\\b)",
       "(" LQ_ENC RQ_ENC ")" } },
 
-  /* left = ":" and right = " " */
+  /* left_quote = ":" and right_quote = " " */
   { { ": ", ":\\0001\\0 ", 9, ":simple ",
       ":\\ \\t\\n'\"\\033?""?/\\\\ ", ":a:b ", ":a\\\\b ",
       ":" LQ_ENC RQ_ENC " " },
@@ -253,7 +254,7 @@ static struct result_groups custom_results[] = {
       ":\\ \\t\\n'\"\\033?""?/\\\\ ", ":a\\:b ", ":a\\\\b ",
       ":" LQ_ENC RQ_ENC " " } },
 
-  /* left = " " and right = ":" */
+  /* left_quote = " " and right_quote = ":" */
   { { " :", " \\0001\\0:", 9, " simple:",
       "  \\t\\n'\"\\033?""?/\\\\:", " a\\:b:", " a\\\\b:",
       " " LQ_ENC RQ_ENC ":" },
@@ -264,16 +265,27 @@ static struct result_groups custom_results[] = {
       "  \\t\\n'\"\\033?""?/\\\\:", " a\\:b:", " a\\\\b:",
       " " LQ_ENC RQ_ENC ":" } },
 
-  /* left = "# " and right = "\n\n" */
-  { { "# \n\n", "# \\0001\\0\n\n", 11, "# simple\n\n",
-      "#  \\t\\n'\"\\033?""?/\\\\\n\n", "# a:b\n\n", "# a\\\\b\n\n",
-      "# " LQ_ENC RQ_ENC "\n\n" },
-    { "# \n\n", "# \\0001\\0\n\n", 11, "# simple\n\n",
-      "#  \\t\\n'\"\\033?""?/\\\\\n\n", "# a:b\n\n", "# a\\\\b\n\n",
-      "# " LQ_ENC RQ_ENC "\n\n" },
-    { "# \n\n", "# \\0001\\0\n\n", 11, "# simple\n\n",
-      "#  \\t\\n'\"\\033?""?/\\\\\n\n", "# a\\:b\n\n", "# a\\\\b\n\n",
-      "# " LQ_ENC RQ_ENC "\n\n" } }
+  /* left_quote = "# " and right_quote = "\n" */
+  { { "# \n", "# \\0001\\0\n", 10, "# simple\n",
+      "#  \\t\\n'\"\\033?""?/\\\\\n", "# a:b\n", "# a\\\\b\n",
+      "# " LQ_ENC RQ_ENC "\n" },
+    { "# \n", "# \\0001\\0\n", 10, "# simple\n",
+      "#  \\t\\n'\"\\033?""?/\\\\\n", "# a:b\n", "# a\\\\b\n",
+      "# " LQ_ENC RQ_ENC "\n" },
+    { "# \n", "# \\0001\\0\n", 10, "# simple\n",
+      "#  \\t\\n'\"\\033?""?/\\\\\n", "# a\\:b\n", "# a\\\\b\n",
+      "# " LQ_ENC RQ_ENC "\n" } },
+
+  /* left_quote = "\"'" and right_quote = "'\"" */
+  { { "\"''\"", "\"'\\0001\\0'\"", 11, "\"'simple'\"",
+      "\"' \\t\\n\\'\"\\033?""?/\\\\'\"", "\"'a:b'\"", "\"'a\\\\b'\"",
+      "\"'" LQ_ENC RQ_ENC "'\"" },
+    { "\"''\"", "\"'\\0001\\0'\"", 11, "\"'simple'\"",
+      "\"' \\t\\n\\'\"\\033?""?/\\\\'\"", "\"'a:b'\"", "\"'a\\\\b'\"",
+      "\"'" LQ_ENC RQ_ENC "'\"" },
+    { "\"''\"", "\"'\\0001\\0'\"", 11, "\"'simple'\"",
+      "\"' \\t\\n\\'\"\\033?""?/\\\\'\"", "\"'a\\:b'\"", "\"'a\\\\b'\"",
+      "\"'" LQ_ENC RQ_ENC "'\"" } }
 };
 
 static void
-- 
1.5.4.3





reply via email to

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