svn commit: trunk/busybox/editors

aldot at busybox.net aldot at busybox.net
Sat Jun 3 21:40:12 UTC 2006


Author: aldot
Date: 2006-06-03 14:40:11 -0700 (Sat, 03 Jun 2006)
New Revision: 15278

Log:
- use bb functions instead of handrolling stuff.
- add XXX question about supposedly superfluous else clause
   text	   data	    bss	    dec	    hex	filename
   5918	      0	      0	   5918	   171e	editors/sed.o.orig
   5901	      0	      0	   5901	   170d	editors/sed.o


Modified:
   trunk/busybox/editors/sed.c


Changeset:
Modified: trunk/busybox/editors/sed.c
===================================================================
--- trunk/busybox/editors/sed.c	2006-06-03 21:23:20 UTC (rev 15277)
+++ trunk/busybox/editors/sed.c	2006-06-03 21:40:11 UTC (rev 15278)
@@ -481,7 +481,7 @@
 		cmdstr = bb_xasprintf("%s\n%s", bbg.add_cmd_line, cmdstr);
 		free(bbg.add_cmd_line);
 		bbg.add_cmd_line = cmdstr;
-	} else bbg.add_cmd_line=NULL;
+	} else bbg.add_cmd_line=NULL; /* XXX: erm.. bbg.add_cmd_line was 0 and we set it to *0 here why? */
 
 	/* If this line ends with backslash, request next line. */
 	temp=strlen(cmdstr);
@@ -737,8 +737,8 @@
 	if(!no_newline) fputc('\n',file);
 
     if(ferror(file)) {
-		fprintf(stderr,"Write failed.\n");
-		exit(4);  /* It's what gnu sed exits with... */
+		bb_default_error_retval = 4;  /* It's what gnu sed exits with... */
+		bb_error_msg_and_die(bb_msg_write_error);
 	}
 
 	return no_newline;




More information about the busybox-cvs mailing list