[BusyBox-cvs] busybox/editors sed.c,1.165,1.166

Erik Andersen andersen at busybox.net
Wed Apr 21 00:57:16 UTC 2004


Update of /var/cvs/busybox/editors
In directory nail:/tmp/cvs-serv7196

Modified Files:
	sed.c 
Log Message:
This sed patch can only be described as "duh".  Stat the source file, chmod
the _destination_ file.  (Ah hah!  That works _much_ better...)  I
implemented the behavior, I just forgot to test this corner of it.  My fault,
sorry...

No, gnu sed -i doesn't preverve ownership information.  I checked.
Permissions, yes, ownership info, no.

Rob



Index: sed.c
===================================================================
RCS file: /var/cvs/busybox/editors/sed.c,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -d -r1.165 -r1.166
--- a/sed.c	21 Apr 2004 00:56:22 -0000	1.165
+++ b/sed.c	21 Apr 2004 00:57:14 -0000	1.166
@@ -1191,7 +1191,7 @@
 						nonstdout=bb_wfopen(outname,"w");
 						/* Set permissions of output file */
 						fstat(fileno(file),&statbuf);
-						fchmod(fileno(file),statbuf.st_mode);
+						fchmod(fileno(nonstdout),statbuf.st_mode);
 						atexit(cleanup_outname);
 					}
 					process_file(file);




More information about the busybox-cvs mailing list