arguments to adb :r command are damaged (4.[12]BSD)
Jeff Mogul
mogul at Coyote
Fri Apr 20 00:08:41 AEST 1984
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;
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list