diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-03-14 09:17:48 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-03-14 09:17:48 +0000 |
commit | 76461ded580ab4fb31b2022f46b816e51cd174e7 (patch) | |
tree | d959429992b378bd3a68b5604168c2ce4d813b21 | |
parent | 743fa97cdd26b39d2031ec44e01dae8a63a37a4b (diff) | |
download | glibc-76461ded580ab4fb31b2022f46b816e51cd174e7.tar.gz glibc-76461ded580ab4fb31b2022f46b816e51cd174e7.tar.xz glibc-76461ded580ab4fb31b2022f46b816e51cd174e7.zip |
(idna_to_ascii_4z): Revert last patch.
-rw-r--r-- | libidn/idna.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/libidn/idna.c b/libidn/idna.c index b89350f1f3..69c928fc42 100644 --- a/libidn/idna.c +++ b/libidn/idna.c @@ -437,21 +437,24 @@ idna_to_ascii_4z (const uint32_t * input, char **output, int flags) U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61 (halfwidth ideographic full stop). */ - if (input[0] == 0 - /* Handle explicit zero-length root label. */ - || (DOTP (input[0]) && input[1] == 0)) + if (input[0] == 0) { -#if defined HAVE_STRDUP || defined _LIBC - *output = strdup (input); - return *output == NULL ? IDNA_MALLOC_ERROR : IDNA_SUCCESS; -#else /* Handle implicit zero-length root label. */ *output = malloc (1); if (!*output) return IDNA_MALLOC_ERROR; - strcpy (*output, input); + strcpy (*output, ""); + return IDNA_SUCCESS; + } + + if (DOTP (input[0]) && input[1] == 0) + { + /* Handle explicit zero-length root label. */ + *output = malloc (2); + if (!*output) + return IDNA_MALLOC_ERROR; + strcpy (*output, "."); return IDNA_SUCCESS; -#endif } *output = NULL; |