Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jun 2002 02:28:03 +1000 (EST)
From:      Andrew <andrew@ugh.net.au>
To:        freebsd-gnats-submit@FreeBSD.org
Cc:        dima@unixfreak.org, <freebsd-bugs@FreeBSD.org>
Subject:   Re: bin/25278: bs accepts -s -c but not -sc
Message-ID:  <20020610022301.Y94582-200000@starbug.ugh.net.au>
In-Reply-To: <20020610021320.X94582-200000@starbug.ugh.net.au>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--0-1524894074-1023640083=:94582
Content-Type: TEXT/PLAIN; charset=US-ASCII



On Mon, 10 Jun 2002, Andrew wrote:

> (other patches to follow)

Ok here is a patch to get bs to use getopt. The diff looks messy but it
basically changes the guts of do_options from parsing command line options
itself to calling getopt. If you apply the patch then compare the
functions manually you can see what it happening.

This patch actually fixes the problem I was having.

Thanks,

Andrew

--0-1524894074-1023640083=:94582
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="bs.2.getopt.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <20020610022803.P94582@starbug.ugh.net.au>
Content-Description: use getopt
Content-Disposition: attachment; filename="bs.2.getopt.patch"

LS0tIGJzLnVzYWdlL2JzLmMJTW9uIEp1biAxMCAwMToyNjoyMCAyMDAyDQor
KysgYnMuZ2V0b3B0L2JzLmMJTW9uIEp1biAxMCAwMjowODoyMiAyMDAyDQpA
QCAtMTEyMSw1MiArMTEyMSw0MSBAQA0KIH0NCiANCiANCi1zdGF0aWMgdm9p
ZCBkb19vcHRpb25zKGMsb3ApDQotaW50IGM7DQotY2hhciAqb3BbXTsNCitz
dGF0aWMgdm9pZCBkb19vcHRpb25zKGFyZ2MsYXJndikNCitpbnQgYXJnYzsN
CitjaGFyICphcmd2W107DQogew0KLSAgICBpbnQgaTsNCisgICAgaW50IGM7
DQogDQotICAgIGlmIChjID4gMSkNC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YWNrID0gMTsNCi0JCSAgICBicmVhazsNCi0JCWRlZmF1
bHQ6DQorCQlicmVhazsNCisJICAgIGNhc2UgJ3MnOg0KKwkJaWYgKGJsaXR6
ID09IDEpDQorCQl7DQogCQkgICAgKHZvaWQpIGZwcmludGYoc3RkZXJyLA0K
LQkJCSAgICAiQmFkIGFyZzogdHlwZSBcIiVzID9cIiBmb3IgdXNhZ2UgbWVz
c2FnZVxuIiwgb3BbMF0pOw0KKwkJCSAgICAiQmFkIEFyZzogLXMgYW5kIC1i
IGFyZSBtdXR1YWxseSBleGNsdXNpdmVcbiIpOw0KIAkJICAgIGV4aXQoMSk7
DQogCQl9DQotCSAgICB9DQorCQllbHNlDQorCQkgICAgc2Fsdm8gPSAxOw0K
KwkJYnJlYWs7DQorCSAgICBjYXNlICdjJzoNCisJCWNsb3NlcGFjayA9IDE7
DQorCQlicmVhazsNCisJICAgIGNhc2UgJz8nOg0KKwkgICAgZGVmYXVsdDoN
CisJCXVzYWdlKCk7DQorCQlicmVhazsNCiAJfQ0KICAgICB9DQogfQ0K
--0-1524894074-1023640083=:94582--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020610022301.Y94582-200000>