public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix transliteration
@ 2005-12-27 14:05 Jakub Jelinek
  2005-12-27 15:05 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2005-12-27 14:05 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

echo -e '\304\217' | elf/ld.so --library-path . iconv/iconv_prog -f utf-8 -t iso-8859-1//translit
segfaults, apparently due to missing demangling.

Fixed thusly:

2005-12-27  Jakub Jelinek  <jakub@redhat.com>

	* iconv/gconv_trans.c (__gconv_transliterate): Demangle step __fct
	before calling it.

--- libc/iconv/gconv_trans.c.jj	2005-09-12 09:28:51.000000000 +0200
+++ libc/iconv/gconv_trans.c	2005-12-27 14:30:39.000000000 +0100
@@ -54,6 +54,12 @@ __gconv_transliterate (struct __gconv_st
   winbuf = (const uint32_t *) *inbufp;
   winbufend = (const uint32_t *) inbufend;
 
+  __gconv_fct fct = step->__fct;
+#ifdef PTR_DEMANGLE
+  if (step->__shlib_handle != NULL)
+    PTR_DEMANGLE (fct);
+#endif
+
   /* If there is no transliteration information in the locale don't do
      anything and return the error.  */
   size = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_TAB_SIZE);
@@ -119,7 +125,7 @@ __gconv_transliterate (struct __gconv_st
 	      /* Try this input text.  */
 	      toinptr = (const unsigned char *) &to_tbl[idx2];
 	      outptr = *outbufstart;
-	      res = DL_CALL_FCT (step->__fct,
+	      res = DL_CALL_FCT (fct,
 				 (step, step_data, &toinptr,
 				  (const unsigned char *) &to_tbl[idx2 + len],
 				  &outptr, NULL, 0, 0));
@@ -204,7 +210,7 @@ __gconv_transliterate (struct __gconv_st
 		? __GCONV_EMPTY_INPUT : __GCONV_INCOMPLETE_INPUT);
 
       outptr = *outbufstart;
-      res = DL_CALL_FCT (step->__fct,
+      res = DL_CALL_FCT (fct,
 			 (step, step_data, &toinptr,
 			  (const unsigned char *) (default_missing + len),
 			  &outptr, NULL, 0, 0));

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix transliteration
  2005-12-27 14:05 [PATCH] Fix transliteration Jakub Jelinek
@ 2005-12-27 15:05 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2005-12-27 15:05 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers

[-- Attachment #1: Type: text/plain, Size: 101 bytes --]

Applied.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-12-27 15:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-27 14:05 [PATCH] Fix transliteration Jakub Jelinek
2005-12-27 15:05 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).