While ed does have some sane CFLAGS hard-coded in configure, gentoo 
users are notably insane and like to optimize anything that moves.

On at least alpha, and sometimes sparc, -O3 (specifically the -finline-
functions flag) would cause a segfault in the testsuites and uses 
elsewhere - anything that piped output to it.

So, a quick change and all should be well. Attached should be the patch 
to fix it.

poly-p man
--- ed-1.2/carg_parser.c.old	2009-01-15 06:24:29.000000000 -0500
+++ ed-1.2/carg_parser.c	2009-04-12 11:39:56.000000000 -0400
@@ -14,21 +14,20 @@
     You should have received a copy of the GNU General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
-
 #include <stdlib.h>
 #include <string.h>
 
 #include "carg_parser.h"
 
-
 /* assure at least a minimum size for buffer `buf' */
-char ap_resize_buffer( void *buf, const int min_size )
+char ap_resize_buffer( void **buf, const int min_size )
   {
-  void *new_buf = 0;
-  if( *(void **)buf ) new_buf = realloc( *(void **)buf, min_size );
-  else new_buf = malloc( min_size );
-  if( !new_buf ) return 0;
-  *(void **)buf = new_buf;
+  void *old_buf = *buf; 
+  *buf = realloc(*buf, min_size); 
+  if (*buf == NULL) { 
+      *buf = old_buf; 
+      return 0; 
+  } 
   return 1;
   }
 

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
bug-ed mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-ed

Reply via email to