Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site decwrl.UUCP Path: utzoo!watmath!clyde!burl!ulysses!harpo!decvax!decwrl!mogul@Coyote From: mogul@Coyote (Jeff Mogul) Newsgroups: net.bugs.4bsd Subject: arguments to adb :r command are damaged (4.[12]BSD) Message-ID: <7215@decwrl.UUCP> Date: Thu, 19-Apr-84 09:08:41 EST Article-I.D.: decwrl.7215 Posted: Thu Apr 19 09:08:41 1984 Date-Received: Fri, 20-Apr-84 01:47:27 EST Organization: DEC Western Research Lab, Los Altos, CA Lines: 40 Description: Arguments after the first supplied to the :r command of ADB have their first character dropped. (Original bug report by cmcl2!rna!dan, 30 Jan 84.) Repeat-By: % adb /bin/echo :r abc def ghi should print: abc def ghi actually prints: abc ef hi Fix: The bug is in doexec() in runpcs.c. The body of the major loop is: throws away spaces copy an argument throws away spaces the problem being that the two different sets of code for throwing away spaces are incompatible in such a way as to discard one extra character each time. My fix is to move some code out of the loop; by turning the do loop into a while loop one could get rid of a redundant test but I didn't bother. The same bug seems to lurk in the 4.1BSD version of adb; probably the same fix would work. *** runpcs.c.old Thu Aug 11 20:06:55 1983 --- runpcs.c Thu Apr 19 01:55:10 1984 *************** *** 171,173 *ap++=symfil; ! REP IF rdc()==EOR THEN break; FI *ap = p; --- 171,174 ----- *ap++=symfil; ! rdc(); ! REP IF lastc==EOR THEN break; FI *ap = p;