about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-24 18:49:37 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-24 18:49:37 +0000
commit17955ae22c472c79abfa6bb9b94ec551336b46a1 (patch)
tree180444fc780bd75882eb3f73d3de03e3e8648873
parent756186e70866e186ea601d8d1ea74e2fa38ab236 (diff)
downloadglibc-17955ae22c472c79abfa6bb9b94ec551336b46a1.tar.gz
glibc-17955ae22c472c79abfa6bb9b94ec551336b46a1.tar.xz
glibc-17955ae22c472c79abfa6bb9b94ec551336b46a1.zip
Update.
	* locale/programs/ld-address.c (iso639): Correct length of string
	elements.
	* sysdeps/unix/sysv/linux/i386/sys/elf.h (elf_fpxregset_t): Define.

	* sysdeps/unix/sysv/linux/i386/sys/user.h (struct user_fpxregs_struct):
	Define.
-rw-r--r--ChangeLog10
-rw-r--r--locale/programs/ld-address.c44
2 files changed, 46 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 3ea6906b56..87809636b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,12 @@
 2000-06-24  Ulrich Drepper  <drepper@redhat.com>
 
-	* sysdeps/unix/sysv/linux/i386/sys/elf.h (elf_fpxregset_t):
-	Define.
+	* locale/programs/ld-address.c (iso639): Correct length of string
+	elements.
 
-	* sysdeps/unix/sysv/linux/i386/sys/user.h (struct
-	user_fpxregs_struct): Define.
+	* sysdeps/unix/sysv/linux/i386/sys/elf.h (elf_fpxregset_t): Define.
+
+	* sysdeps/unix/sysv/linux/i386/sys/user.h (struct user_fpxregs_struct):
+	Define.
 
 	* elf/elf.h (NT_PRFPXREG): Define.
 
diff --git a/locale/programs/ld-address.c b/locale/programs/ld-address.c
index da801d09d4..3e94e117cb 100644
--- a/locale/programs/ld-address.c
+++ b/locale/programs/ld-address.c
@@ -48,9 +48,9 @@ static struct
 
 static struct
 {
-  const char ab[2];
-  const char term[3];
-  const char lib[3];
+  const char ab[3];
+  const char term[4];
+  const char lib[4];
 } iso639[] =
 {
 #define DEFINE_LANGUAGE_CODE(Name, Ab, Term, Lib) \
@@ -499,12 +499,48 @@ address_read (struct linereader *ldfile, struct localedef_t *result,
 	  STR_ELEM (country_ab2);
 	  STR_ELEM (country_ab3);
 	  STR_ELEM (country_car);
-	  STR_ELEM (country_isbn);
 	  STR_ELEM (lang_name);
 	  STR_ELEM (lang_ab);
 	  STR_ELEM (lang_term);
 	  STR_ELEM (lang_lib);
 
+#define INT_STR_ELEM(cat) \
+	case tok_##cat:							      \
+	  /* Ignore the rest of the line if we don't need the input of	      \
+	     this line.  */						      \
+	  if (ignore_content)						      \
+	    {								      \
+	      lr_ignore_rest (ldfile, 0);				      \
+	      break;							      \
+	    }								      \
+									      \
+	  arg = lr_token (ldfile, charmap, NULL);			      \
+	  if (arg->tok != tok_string && arg->tok != tok_number)		      \
+	    goto err_label;						      \
+	  if (address->cat != NULL)					      \
+	    lr_error (ldfile, _("\
+%s: field `%s' declared more than once"), "LC_ADDRESS", #cat);		      \
+	  else if (!ignore_content && arg->val.str.startmb == NULL)	      \
+	    {								      \
+	      lr_error (ldfile, _("\
+%s: unknown character in field `%s'"), "LC_ADDRESS", #cat);		      \
+	      address->cat = "";					      \
+	    }								      \
+	  else if (!ignore_content)					      \
+	    {								      \
+	      if (arg->tok == tok_string)				      \
+		address->cat = arg->val.str.startmb;			      \
+	      else							      \
+		{							      \
+		  char *numbuf = (char *) xmalloc (11);			      \
+		  snprintf (numbuf, 11, "%ld", arg->val.num);		      \
+		  address->cat = numbuf;				      \
+		}							      \
+	    }								      \
+	  break
+
+	  INT_STR_ELEM (country_isbn);
+
 #define INT_ELEM(cat) \
 	case tok_##cat:							      \
 	  /* Ignore the rest of the line if we don't need the input of	      \