Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Dec 2014 21:55:14 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 195929] New: usr.bin/sed -- eliminate one malloc and add consts
Message-ID:  <bug-195929-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195929

            Bug ID: 195929
           Summary: usr.bin/sed -- eliminate one malloc and add consts
           Product: Base System
           Version: 10.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: mi@ALDAN.algebra.com

Created attachment 150515
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=150515&action=edit
Process -e optarg verbatim

When encountering an -e argument, sed currently mallocs a string to COPY the
optarg -- with '\n' appended. The appendage does not seem necessary -- indeed,
the same call to add_compunit processing the sole command (given without -e)
passes the *argv verbatim: without making a copy, and without appending
newline.

The patch eliminates the seemingly redundant malloc/string-copying.

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-195929-8>