cvs commit: src/bin/sh expand.c

Bill Fenner fenner at FreeBSD.org
Fri May 30 23:28:00 PDT 2003


fenner      2003/05/30 23:27:58 PDT

  FreeBSD src repository

  Modified files:
    bin/sh               expand.c 
  Log:
  Instead of eating trailing newlines after inserting them into the
  output buffer, don't insert them at all.  This prevents a buffer
  *underrun* when the substitution consists completely of newlines
  (e.g. `echo`) and the byte before the source buffer to which p
  points is a '\n', in which case more characters would be removed
  from the output buffer than were inserted.
  
  This fixes certain port builds on sparc64.
  
  Approved by:    re (scottl)
  Reviewed by:    des, tjr
  
  Revision  Changes    Path
  1.43      +12 -5     src/bin/sh/expand.c


More information about the cvs-src mailing list