]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(getenv): Fix lookup for single character variable on bigendian
authorUlrich Drepper <drepper@redhat.com>
Fri, 10 Sep 1999 19:13:51 +0000 (19:13 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 10 Sep 1999 19:13:51 +0000 (19:13 +0000)
platforms without unaligned memory access.

sysdeps/generic/getenv.c

index 584b120bb7f111a34ab774d899972ff5153f51e2..e9887cb838af117aec6a473c0e2b0e0beaca5494 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991, 1992, 1994, 1996, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1994, 1996, 1998, 1999
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -49,7 +50,7 @@ getenv (name)
       /* The name of the variable consists of only one character.  Therefore
         the first two characters of the environment entry are this character
         and a '=' character.  */
-#if __BYTE_ORDER == __LITTLE_ENDIAN
+#if __BYTE_ORDER == __LITTLE_ENDIAN || !_STRING_ARCH_unaligned
       name_start = ('=' << 8) | *(const unsigned char *) name;
 #else
 # if __BYTE_ORDER == __BIG_ENDIAN