# HG changeset patch # User Rob Landley # Date 1363926229 18000 # Node ID 98c396477e0b9c82ddad4a7256c117b776827a76 # Parent 457d4cdc937e003a589409dfd7bc00fbc707dec6 Fix a bug in patch I fixed back in 2010 but forgot to apply here. diff -r 457d4cdc937e -r 98c396477e0b toys/posix/patch.c --- a/toys/posix/patch.c Thu Mar 21 20:21:12 2013 -0500 +++ b/toys/posix/patch.c Thu Mar 21 23:23:49 2013 -0500 @@ -394,7 +394,7 @@ TT.filein = xcreate(name, O_CREAT|O_EXCL|O_RDWR, 0666); } else { printf("patching %s\n", name); - TT.filein = xopen(name, O_RDWR); + TT.filein = xopen(name, O_RDONLY); } TT.fileout = copy_tempfile(TT.filein, name, &TT.tempname); TT.linenum = 0;