This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Fwd: getenv() in glibc


Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:

|> Hi,
|> 
|> I just verified Frank's report on Linux/PPC, does this happen on other 
|> platforms too?

I don't know which platforms that are, but it happens on all bigendian
platforms that don't allow unaligned memory accesses (sparc?).


1999-09-10  Andreas Schwab  <schwab@suse.de>

	* sysdeps/generic/getenv.c (getenv): Fix lookup for single
	character variable on bigendian platforms without unaligned memory
	access.

Index: sysdeps/generic/getenv.c
===================================================================
RCS file: /glibc/cvsfiles/libc/sysdeps/generic/getenv.c,v
retrieving revision 1.7
diff -u -a -u -r1.7 sysdeps/generic/getenv.c
--- sysdeps/generic/getenv.c	1998/06/12 07:35:30	1.7
+++ sysdeps/generic/getenv.c	1999/09/10 12:19:04
@@ -49,7 +49,7 @@
       /* 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

-- 
Andreas Schwab                                  "And now for something
schwab@suse.de                                   completely different."
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]