summaryrefslogtreecommitdiff
path: root/src/tr.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-07-13 18:37:16 +0200
committerJim Meyering <jim@meyering.net>2007-07-13 18:37:16 +0200
commit916fcda554f5859ee51c4fb13031728a54d92a52 (patch)
tree43d24a71bfd2fe657ee49cf88e6228ffb55ef3ac /src/tr.c
parentd26ba897eb944b84e4af7e1744e12b98803ccc4c (diff)
downloadcoreutils-916fcda554f5859ee51c4fb13031728a54d92a52.tar.xz
Warn about non-portable use of unescaped backslash at end of string,
and treat it as if it were escaped. * src/tr.c (unquote): Considering that such usage would make GNU tr from coreutils-5.2.1 and earlier *fail*, the least we can do now is to warn about it. Solaris' tr ignores it. * NEWS: Mention this.
Diffstat (limited to 'src/tr.c')
-rw-r--r--src/tr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tr.c b/src/tr.c
index 28eeac35a..871542a27 100644
--- a/src/tr.c
+++ b/src/tr.c
@@ -525,8 +525,9 @@ unquote (char const *s, struct E_string *es)
}
break;
case '\0':
- /* POSIX seems to require that a trailing backslash must
- stand for itself. Weird. */
+ error (0, 0, _("warning: an unescaped backslash "
+ "at end of string is not portable"));
+ /* POSIX is not clear about this. */
es->escaped[j] = false;
i--;
c = '\\';