From: Eric Andersen Date: Wed, 21 Apr 2004 00:57:14 +0000 (-0000) Subject: This sed patch can only be described as "duh". Stat the source file, chmod X-Git-Tag: 1_00_rc1~77 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b94669543df39440415d734ad2932a83651471e9;p=oweals%2Fbusybox.git 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 --- diff --git a/editors/sed.c b/editors/sed.c index 968d0d2a2..750f41acd 100644 --- a/editors/sed.c +++ b/editors/sed.c @@ -1191,7 +1191,7 @@ extern int sed_main(int argc, char **argv) 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);