about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-12-16 18:25:45 +0000
committerUlrich Drepper <drepper@redhat.com>2000-12-16 18:25:45 +0000
commit0a70515e2ebc0060ab53b83cd9c0a379706da986 (patch)
tree19ab873658fba2dd7a45577bd5bc89eb0c47e0aa
parent3d73829c187f7d34c5c3c44047da1137adf36d86 (diff)
downloadglibc-0a70515e2ebc0060ab53b83cd9c0a379706da986.tar.gz
glibc-0a70515e2ebc0060ab53b83cd9c0a379706da986.tar.xz
glibc-0a70515e2ebc0060ab53b83cd9c0a379706da986.zip
Update.
2000-12-16  Jakub Jelinek  <jakub@redhat.com>

	* catgets/gencat.c (read_input_file): Avoid calling obstack_free
	with a pointer not returned by obstack_ functions.

	* sysdeps/unix/sysv/aix/bits/stat.h (struct stat): Align with AIX
	version.
	(struct stat64): Likewise.
	Reported by Michael Keezer <mkeezer@redhat.com>.
-rw-r--r--ChangeLog10
-rw-r--r--catgets/gencat.c29
-rw-r--r--sysdeps/unix/sysv/aix/bits/stat.h12
3 files changed, 28 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index e34457af82..9ffa26df7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
+2000-12-16  Jakub Jelinek  <jakub@redhat.com>
+
+	* catgets/gencat.c (read_input_file): Avoid calling obstack_free
+	with a pointer not returned by obstack_ functions.
+
 2000-12-16  Ulrich Drepper  <drepper@redhat.com>
 
+	* sysdeps/unix/sysv/aix/bits/stat.h (struct stat): Align with AIX
+	version.
+	(struct stat64): Likewise.
+	Reported by Michael Keezer <mkeezer@redhat.com>.
+
 	* timezone/asia: Update from tzdata2000h.
 	* timezone/australasia: Likewise.
 	* timezone/backward: Likewise.
diff --git a/catgets/gencat.c b/catgets/gencat.c
index 49b63363ba..43988e7cc8 100644
--- a/catgets/gencat.c
+++ b/catgets/gencat.c
@@ -566,13 +566,14 @@ this is the first definition"));
       else if (isalnum (this_line[0]) || this_line[0] == '_')
 	{
 	  const char *ident = this_line;
+	  char *line = this_line;
 	  int message_number;
 
 	  do
-	    ++this_line;
-	  while (this_line[0] != '\0' && !isspace (this_line[0]));
-	  if (this_line[0] != '\0')
-	    *this_line++ = '\0';	/* Terminate the identifier.  */
+	    ++line;
+	  while (line[0] != '\0' && !isspace (line[0]));
+	  if (line[0] != '\0')
+	    *line++ = '\0';	/* Terminate the identifier.  */
 
 	  /* Now we found the beginning of the message itself.  */
 
@@ -647,7 +648,7 @@ duplicated message identifier"));
 	      char *outbuf;
 	      size_t outlen;
 	      struct message_list *newp;
-	      size_t this_line_len = strlen (this_line) + 1;
+	      size_t line_len = strlen (line) + 1;
 
 	      /* We need the conversion.  */
 	      if (cd_towc == (iconv_t) -1
@@ -662,8 +663,8 @@ duplicated message identifier"));
 		 message is stateful.  */
 	      while (1)
 		{
-		  inbuf = this_line;
-		  inlen = this_line_len;
+		  inbuf = line;
+		  inlen = line_len;
 		  outbuf = (char *) wbuf;
 		  outlen = wbufsize;
 
@@ -693,8 +694,6 @@ invalid character: message ignored"));
 		  wbuf = (wchar_t *) xrealloc (wbuf, wbufsize);
 		}
 
-	      used = 1;	/* Yes, we use the line.  */
-
 	      /* Strip quote characters, change escape sequences into
 		 correct characters etc.  */
 	      normalize_line (fname, start_line, cd_towc, wbuf,
@@ -705,14 +704,17 @@ invalid character: message ignored"));
 		 memory allocated for the original string.  */
 	      obstack_free (&current->mem_pool, this_line);
 
+	      used = 1;	/* Yes, we use the line.  */
+
 	      /* Now fill in the new string.  It should never happen that
 		 the replaced string is longer than the original.  */
 	      inbuf = (char *) wbuf;
 	      inlen = (wcslen (wbuf) + 1) * sizeof (wchar_t);
 
 	      outlen = obstack_room (&current->mem_pool);
-	      start_line = (char *) obstack_alloc (&current->mem_pool, outlen);
-	      outbuf = start_line;
+	      obstack_blank (&current->mem_pool, outlen);
+	      this_line = (char *) obstack_base (&current->mem_pool);
+	      outbuf = this_line;
 
 	      /* Flush the state.  */
 	      iconv (cd_tomb, NULL, NULL, NULL, NULL);
@@ -727,11 +729,12 @@ invalid character: message ignored"));
 	      assert (outbuf[-1] == '\0');
 
 	      /* Free the memory in the obstack we don't use.  */
-	      obstack_free (&current->mem_pool, outbuf);
+	      obstack_blank (&current->mem_pool, -(int) outlen);
+	      line = obstack_finish (&current->mem_pool);
 
 	      newp = (struct message_list *) xmalloc (sizeof (*newp));
 	      newp->number = message_number;
-	      newp->message = this_line;
+	      newp->message = line;
 	      /* Remember symbolic name; is NULL if no is given.  */
 	      newp->symbol = ident;
 	      /* Remember where we found the character.  */
diff --git a/sysdeps/unix/sysv/aix/bits/stat.h b/sysdeps/unix/sysv/aix/bits/stat.h
index 2d5585debb..0b818795e7 100644
--- a/sysdeps/unix/sysv/aix/bits/stat.h
+++ b/sysdeps/unix/sysv/aix/bits/stat.h
@@ -23,11 +23,7 @@
 struct stat
   {
     __dev_t st_dev;			/* Device.  */
-#ifndef __USE_FILE_OFFSET64
     __ino_t st_ino;			/* File serial number.	*/
-#else
-    __ino64_t st_ino;			/* File serial number.	*/
-#endif
     __mode_t st_mode;			/* File mode.  */
     __nlink_t st_nlink;			/* Link count.  */
     unsigned short int st_flag;		/* Flag word.  */
@@ -46,11 +42,7 @@ struct stat
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int __unused3;
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
-#ifndef __USE_FILE_OFFSET64
     __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
-#else
-    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
-#endif
     int st_vfstype;			/* Type of the filesystem.  */
     unsigned int st_vfs;		/* Vfs number.  */
     unsigned int st_type;		/* Vnode type.  */
@@ -69,7 +61,7 @@ struct stat
 struct stat64
   {
     __dev_t st_dev;			/* Device.  */
-    __ino64_t st_ino;			/* File serial number.	*/
+    __ino_t st_ino;			/* File serial number.	*/
     __mode_t st_mode;			/* File mode.  */
     __nlink_t st_nlink;			/* Link count.  */
     unsigned short int st_flag;		/* Flag word.  */
@@ -84,7 +76,7 @@ struct stat64
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int __unused3;
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
-    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
+    __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
     int st_vfstype;			/* Type of the filesystem.  */
     unsigned int st_vfs;		/* Vfs number.  */
     unsigned int st_type;		/* Vnode type.  */