RCS 5.7 delete all revs bug

John Kelly <[email protected]> Wed, 1 Jul 2020 21:09:39 +0000
Newsgroups gmane.comp.version-control.rcs.bugs
Message-ID <CAGK5y75K+9=SXpUhNZ11ZUrmdAS-37w6DA9uAnDgi1M_t50iMg@mail.gmail.com>
--0000000000005fe8e805a967b6bd
Content-Type: text/plain; charset="UTF-8"

This bug is NOT in 5.6 or 5.8.1, only 5.7. But I use
RCS on DOS and don't care about any release after 5.7.

Here's the fix pasted inline, but who knows
about the gmail formatting. I will attach the
diff to try and preserve the tabs.



fix -o1.1: (delete all revs) bug
skip fastcopy() when Head == null
it's extra junk now, and we don't
want it trashing our clean repo


diff -Nru a/rcsedit.c b/rcsedit.c
--- a/rcsedit.c    1995-06-16 06:19:24 +0000
+++ b/rcsedit.c    2020-07-01 20:30:24 +0000
@@ -1882,7 +1882,8 @@

     if (changed && !nerror) {
         if (finptr) {
-            fastcopy(finptr, frewrite);
+            if (Head)
+                fastcopy(finptr, frewrite);
             Izclose(&finptr);
         }
         if (1 < RCSstat.st_nlink)

--0000000000005fe8e805a967b6bd
Content-Type: text/plain; charset="US-ASCII"; name="bugdiff.txt"
Content-Disposition: attachment; filename="bugdiff.txt"
Content-Transfer-Encoding: base64
Content-ID: <f_kc3upujt0>
X-Attachment-Id: f_kc3upujt0

ZGlmZiAtTnJ1IGEvcmNzZWRpdC5jIGIvcmNzZWRpdC5jDQotLS0gYS9yY3NlZGl0LmMJMTk5NS0w
Ni0xNiAwNjoxOToyNCArMDAwMA0KKysrIGIvcmNzZWRpdC5jCTIwMjAtMDctMDEgMjA6MzA6MjQg
KzAwMDANCkBAIC0xODgyLDcgKzE4ODIsOCBAQA0KIA0KIAlpZiAoY2hhbmdlZCAmJiAhbmVycm9y
KSB7DQogCQlpZiAoZmlucHRyKSB7DQotCQkJZmFzdGNvcHkoZmlucHRyLCBmcmV3cml0ZSk7DQor
CQkJaWYgKEhlYWQpDQorCQkJCWZhc3Rjb3B5KGZpbnB0ciwgZnJld3JpdGUpOw0KIAkJCUl6Y2xv
c2UoJmZpbnB0cik7DQogCQl9DQogCQlpZiAoMSA8IFJDU3N0YXQuc3RfbmxpbmspDQoNCg0K
--0000000000005fe8e805a967b6bd--