GNU bug report logs -
#15033
[PATCH] Fix display of symbols containing backslashes
Previous Next
Reported by: David Kastrup <dak <at> gnu.org>
Date: Tue, 6 Aug 2013 13:45:02 UTC
Severity: normal
Tags: patch
Done: Mark H Weaver <mhw <at> netris.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#15033: [PATCH] Fix display of symbols containing backslashes
which was filed against the guile package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 15033 <at> debbugs.gnu.org.
--
15033: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15033
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
David Kastrup <dak <at> gnu.org> writes:
> Symbols printed with `#{...#}' notation need to double backslashes when
> displaying as they serve as escape characters when reading. The
> behavior before this patch is clearly erroneous:
>
> GNU Guile 2.0.7
> [...]
> scheme@(guile-user)> (string->symbol "\\(")
> $1 = #{\\x28;}#
> scheme@(guile-user)> (symbol->string '#{\\x28;}#)
> $2 = "\\x28;"
> ---
> libguile/print.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libguile/print.c b/libguile/print.c
> index 50f5a3e..bb7fd84 100644
> --- a/libguile/print.c
> +++ b/libguile/print.c
> @@ -448,7 +448,8 @@ print_extended_symbol (SCM sym, SCM port)
> SUBSEQUENT_IDENTIFIER_MASK
> | UC_CATEGORY_MASK_Zs))
> {
> - if (!display_character (c, port, strategy))
> + if (!display_character (c, port, strategy)
> + || (c == '\\' && !display_character (c, port, strategy)))
> scm_encoding_error ("print_extended_symbol", errno,
> "cannot convert to output locale",
> port, SCM_MAKE_CHAR (c));
Applied in b4a099883d20d7852c95acf07ab6cbc56bce18c4.
Thanks!
Mark
[Message part 3 (message/rfc822, inline)]
Symbols printed with `#{...#}' notation need to double backslashes when
displaying as they serve as escape characters when reading. The
behavior before this patch is clearly erroneous:
GNU Guile 2.0.7
[...]
scheme@(guile-user)> (string->symbol "\\(")
$1 = #{\\x28;}#
scheme@(guile-user)> (symbol->string '#{\\x28;}#)
$2 = "\\x28;"
---
libguile/print.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libguile/print.c b/libguile/print.c
index 50f5a3e..bb7fd84 100644
--- a/libguile/print.c
+++ b/libguile/print.c
@@ -448,7 +448,8 @@ print_extended_symbol (SCM sym, SCM port)
SUBSEQUENT_IDENTIFIER_MASK
| UC_CATEGORY_MASK_Zs))
{
- if (!display_character (c, port, strategy))
+ if (!display_character (c, port, strategy)
+ || (c == '\\' && !display_character (c, port, strategy)))
scm_encoding_error ("print_extended_symbol", errno,
"cannot convert to output locale",
port, SCM_MAKE_CHAR (c));
--
1.8.1.2
This bug report was last modified 11 years and 288 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.