@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
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
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);
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);