Fix some typos in documentation.
[m17n/m17n-lib.git] / src / mtext.c
index 6340339..0439829 100644 (file)
@@ -2622,8 +2622,8 @@ mtext_ins_char (MText *mt, int pos, int c, int n)
     @brief Replace sub-text of M-text with another.
 
     The mtext_replace () function replaces sub-text of M-text $MT1
-    between $FROM1 (inclusive) and $TO1 (exclusinve) with the sub-text
-    of M-text $MT2 between $FROM2 (inclusive) and $TO2 (exclusinve).
+    between $FROM1 (inclusive) and $TO1 (exclusive) with the sub-text
+    of M-text $MT2 between $FROM2 (inclusive) and $TO2 (exclusive).
     The new sub-text inherits text properties of the old sub-text.
 
     @return If the operation was successful, mtext_replace () returns
@@ -3454,7 +3454,7 @@ mtext_lowercase (MText *mt)
     The mtext_titlecase () function destructively converts the first
     character with the cased property in M-text $MT to titlecase and
     the others to lowercase.  The length of $MT may change.  If the
-    character cannot be converted to titlercase, it is left unchanged.
+    character cannot be converted to titlecase, it is left unchanged.
     All the text properties are inherited.
 
     @return
@@ -3606,7 +3606,10 @@ mdebug_dump_mtext (MText *mt, int indent, int fullp)
       for (i = 0; i < mt->nchars; i++)
        {
          int c = mtext_ref_char (mt, i);
-         if (c >= ' ' && c < 127)
+
+         if (c == '"' || c == '\\')
+           fprintf (stderr, "\\%c", c);
+         else if (c >= ' ' && c < 127)
            fprintf (stderr, "%c", c);
          else
            fprintf (stderr, "\\x%02X", c);
@@ -3626,7 +3629,9 @@ mdebug_dump_mtext (MText *mt, int indent, int fullp)
          int len;
          int c = STRING_CHAR_AND_BYTES (p, len);
 
-         if (c >= ' ' && c < 127 && c != '\\' && c != '\"')
+         if (c == '"' || c == '\\')
+           fprintf (stderr, "\\%c", c);
+         else if (c >= ' ' && c < 127)
            fputc (c, stderr);
          else
            fprintf (stderr, "\\x%X", c);