DragonFly-2.3.1.286.gedc2d master bin/sh eval.c

Stathis Kamperis beket at crater.dragonflybsd.org
Wed Jun 17 07:04:23 PDT 2009


commit edc2dda3dc3fccec8603cc28bc8650188872e8d4
Author: Stathis Kamperis <beket at dragonflybsd.org>
Date:   Wed Jun 17 16:21:16 2009 +0300

    sh(1): Reset getopt(3) before executing built-in commands.
    
    Before patch:
    $ printf "test\n"
    test
    $ jobs -l
    $ printf "test\n"
    usage: printf format [arg ...]
    $
    
    After patch:
    $ printf "test\n"
    test
    $ jobs -l
    $ printf "test\n"
    test
    $
    
    The bug isn't tight to jobs(1) or printf(1). Every use of getopt(3) would
    advance `optind' and make the next built-in command think that it wasn't
    supplied with enough arguments. NetBSD is doing as we do. FreeBSD doesn't
    have printf(1) as built-in so it is not affected. The patch has survived
    a build{world, kernel}.

Summary of changes:
 bin/sh/eval.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/edc2dda3dc3fccec8603cc28bc8650188872e8d4


-- 
DragonFly BSD source repository





More information about the Commits mailing list