Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site lsuc.UUCP Path: utzoo!utcs!lsuc!msb From: msb@lsuc.UUCP (Mark Brader) Newsgroups: net.sources.bugs Subject: Bug in patch Message-ID: <458@lsuc.UUCP> Date: Fri, 1-Mar-85 01:14:37 EST Article-I.D.: lsuc.458 Posted: Fri Mar 1 01:14:37 1985 Date-Received: Fri, 1-Mar-85 03:17:38 EST Reply-To: msb@lsuc.UUCP (Mark Brader) Organization: Law Society of Upper Canada, Toronto Lines: 34 Summary: Change say(buf) to say("%s",buf) There's a bug in Larry Wall's generally lovely utility "patch". When he's dumping out the lines "leading up to" the context diff, he passes the lines themselves as formats to fprintf. This fails if they are very long or if they contain '%'. The fix is very simple. If this message has a long enough news path, you may need to strip off the netnews header before you can use patch to install the fix, though... *** patch.c.old Sat Dec 29 21:10:06 1984 --- patch.c Fri Mar 1 00:57:44 1985 *************** *** 1165,1171 while (ftell(pfp) < file_pos) { ret = fgets(buf,sizeof buf,pfp); assert(ret != Nullch); ! say(buf); } say("--------------------------\n"); } --- 1165,1171 ----- while (ftell(pfp) < file_pos) { ret = fgets(buf,sizeof buf,pfp); assert(ret != Nullch); ! say("%s",buf); } say("--------------------------\n"); } Mark Brader