Re: cmp(1) '-s' flag ignoring byte offset argument?

2021-01-10 Thread Jordan Geoghegan
On 1/9/21 1:59 AM, Otto Moerbeek wrote: > On Sat, Jan 09, 2021 at 12:05:31AM -0800, William Ahern wrote: > >> On Fri, Jan 08, 2021 at 07:09:01PM -0800, Jordan Geoghegan wrote: >>> Hey folks, >>> >>> I've noticed some surprising behaviour from cmp(1) when using the '-s' >>> flag. >>> >>> It

Re: cmp(1) '-s' flag ignoring byte offset argument?

2021-01-09 Thread Otto Moerbeek
On Sat, Jan 09, 2021 at 12:05:31AM -0800, William Ahern wrote: > On Fri, Jan 08, 2021 at 07:09:01PM -0800, Jordan Geoghegan wrote: > > Hey folks, > > > > I've noticed some surprising behaviour from cmp(1) when using the '-s' > > flag. > > > > It appears that cmp -s is ignoring the byte offset

Re: cmp(1) '-s' flag ignoring byte offset argument?

2021-01-09 Thread William Ahern
On Sat, Jan 09, 2021 at 12:05:31AM -0800, William Ahern wrote: > Interestingly, DragonflyBSD and FreeBSD already do it this way[3][4], yet I > can confirm FreeBSD still has the problem. (DragonflyBSD has nearly > identical code.) But that implementation duplicates the short-circuit, along > with

Re: cmp(1) '-s' flag ignoring byte offset argument?

2021-01-09 Thread William Ahern
On Fri, Jan 08, 2021 at 07:09:01PM -0800, Jordan Geoghegan wrote: > Hey folks, > > I've noticed some surprising behaviour from cmp(1) when using the '-s' > flag. > > It appears that cmp -s is ignoring the byte offset arguments I'm giving > it. > Not sure what to make of this, I noticed this

Re: cmp(1) '-s' flag ignoring byte offset argument?

2021-01-08 Thread Otto Moerbeek
On Fri, Jan 08, 2021 at 07:09:01PM -0800, Jordan Geoghegan wrote: > Hey folks, > > I've noticed some surprising behaviour from cmp(1) when using the '-s' flag. > > It appears that cmp -s is ignoring the byte offset arguments I'm giving it. > > I don't want to waste time babbling, so here's an

cmp(1) '-s' flag ignoring byte offset argument?

2021-01-08 Thread Jordan Geoghegan
Hey folks, I've noticed some surprising behaviour from cmp(1) when using the '-s' flag. It appears that cmp -s is ignoring the byte offset arguments I'm giving it. I don't want to waste time babbling, so here's an example snippet to show what I'm talking about: #!/bin/sh echo 'my line' >