OSDN Git Service

merge from gcc
authordj <dj>
Tue, 25 Sep 2001 23:02:03 +0000 (23:02 +0000)
committerdj <dj>
Tue, 25 Sep 2001 23:02:03 +0000 (23:02 +0000)
libiberty/ChangeLog
libiberty/concat.c

index 22bf58c..13bdd39 100644 (file)
@@ -1,3 +1,7 @@
+2001-09-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * concat.c (reconcat): Fix for traditional C.
+
 2001-09-24  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * concat.c (reconcat): New function.
index 136e8be..cf026cf 100644 (file)
@@ -188,10 +188,9 @@ reconcat VPARAMS ((char *optr, const char *first, ...))
   VA_FIXEDARG (args, char *, optr);
   VA_FIXEDARG (args, const char *, first);
   vconcat_copy (newstr, first, args);
-  VA_CLOSE (args);
-
-  if (optr)
+  if (optr) /* Done before VA_CLOSE so optr stays in scope for K&R C.  */
     free (optr);
+  VA_CLOSE (args);
 
   return newstr;
 }