From owner-freebsd-bugs Mon Dec 3 6:40: 7 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id BFD0437B405 for ; Mon, 3 Dec 2001 06:40:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id fB3Ee1Q96220; Mon, 3 Dec 2001 06:40:01 -0800 (PST) (envelope-from gnats) Date: Mon, 3 Dec 2001 06:40:01 -0800 (PST) Message-Id: <200112031440.fB3Ee1Q96220@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Ruslan Ermilov Subject: Re: bin/32433: Cannot specify files beginning with + on ee command line. Reply-To: Ruslan Ermilov Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/32433; it has been noted by GNATS. From: Ruslan Ermilov To: Kutulu Cc: bug-followup@FreeBSD.org, Hugh Mahon Subject: Re: bin/32433: Cannot specify files beginning with + on ee command line. Date: Mon, 3 Dec 2001 16:38:14 +0200 On Sat, Dec 01, 2001 at 07:10:01PM -0800, Kutulu wrote: > The following reply was made to PR bin/32433; it has been noted by GNATS. > > From: "Kutulu" > To: , "Kutulu" > Cc: > Subject: Re: bin/32433: Cannot specify files beginning with + on ee command line. > Date: Sat, 1 Dec 2001 22:02:43 -0500 > > And of course, I completely screwed up the patch. This is why I should > leave this stuff up to the professionals. This one works, but it looks > ugly, so I'm sure there's a better way: > > --- ee.c.old Sat Dec 1 20:40:09 2001 > +++ ee.c Sat Dec 1 22:07:13 2001 > @@ -2091,7 +2091,7 @@ > fprintf(stderr, usage4); > exit(1); > } > - else if (*buff == '+') > + else if ((*buff == '+') && (isdigit(*(buff + 1)))) > { > buff++; > start_at_line = buff; > Err, this patch is not quite correct either, as it won't allow to open files with a digit after a plus sign. The correct thing to here would be to check that there's still argument pending on a command line, as "+offset" doesn't make any sense if specified as a last argument. ee(1) is the contributed software, and hence doesn't use an unportable getopt(3) interface. I'd also suggest that the author introduce the support for "--" (cancel options list processing), then the problem could be easily avoided (the Unix way) like this: "ee ... +10 -- ". Currently, opening a file with the name of "-[ieh?]" doesn't work as well. I've Cc:ed the author of this program. Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message