[BusyBox-cvs] busybox.stable sed.c,1.82,1.83

Erik Andersen andersen at busybox.net
Tue Dec 23 21:49:14 UTC 2003


Update of /var/cvs/busybox.stable
In directory nail:/tmp/cvs-serv7795

Modified Files:
	sed.c 
Log Message:
Backport sed from busybox 1.0.0-pre, since the current 0.60.x one
was so horribly broken.


Index: sed.c
===================================================================
RCS file: /var/cvs/busybox.stable/sed.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- sed.c	17 Sep 2002 07:56:25 -0000	1.82
+++ sed.c	23 Dec 2003 21:49:12 -0000	1.83
@@ -1,8 +1,11 @@
+/* vi: set sw=4 ts=4: */
 /*
  * sed.c - very minimalist version of sed
  *
- * Copyright (C) 1999,2000 by Lineo, inc. and Mark Whitley
- * Copyright (C) 1999,2000,2001 by Mark Whitley <markw at codepoet.org> 
+ * Copyright (C) 1999,2000,2001 by Lineo, inc. and Mark Whitley
+ * Copyright (C) 1999,2000,2001 by Mark Whitley <markw at codepoet.org>
+ * Copyright (C) 2002  Matt Kraai
+ * Copyright (C) 2003 by Glenn McGrath <bug1 at optushome.com.au>
  *
[...1745 lines suppressed...]
+			if(!strcmp(argv[i], "-")) {
+				process_file(stdin);
 			} else {
-				process_file(file);
-				fclose(file);
+				file = wfopen(argv[i], "r");
+				if (file) {
+					process_file(file);
+					fclose(file);
+				} else {
+					status = EXIT_FAILURE;
+				}
 			}
 		}
 	}
-	
-	return 0;
+
+	return status;
 }




More information about the busybox-cvs mailing list