Re: [coreutils] basename/dirname can't handle stdin?

2011-01-13 Thread Jeff Blaine
On 1/13/2011 2:53 AM, Jim Meyering wrote: Jeff Blaine wrote: Eric, now that I've got the prereqs in place, built coreutils from git successfully, and read the coreutils HACKING file, let's make sure I am on your page: In no order: * Snarf getopt_long arg processing from wc.c or other you

Re: [coreutils] basename/dirname can't handle stdin?

2011-01-13 Thread Jim Meyering
Philipp Thomas wrote: * Jim Meyering (j...@meyering.net) [20110113 08:53]: * Add --suffix [suffix] to enable suffix killing (using SUFFIX as the 2nd arg will no longer work going forward) Using SUFFIX as the second argument IMO has to keep working as otherwise you'll break tons

Re: [coreutils] basename/dirname can't handle stdin?

2011-01-13 Thread Eric Blake
On 01/13/2011 08:03 AM, Jim Meyering wrote: Philipp Thomas wrote: * Jim Meyering (j...@meyering.net) [20110113 08:53]: * Add --suffix [suffix] to enable suffix killing (using SUFFIX as the 2nd arg will no longer work going forward) Using SUFFIX as the second argument IMO has to keep

Re: [coreutils] basename/dirname can't handle stdin?

2011-01-13 Thread Jim Meyering
Eric Blake wrote: On 01/13/2011 08:03 AM, Jim Meyering wrote: Philipp Thomas wrote: * Jim Meyering (j...@meyering.net) [20110113 08:53]: * Add --suffix [suffix] to enable suffix killing (using SUFFIX as the 2nd arg will no longer work going forward) Using SUFFIX as the second argument

[coreutils] [PATCH] maint: trivial system header file cleanups

2011-01-13 Thread Pádraig Brady
From e1aaf8903db97f3240b1551fd6936ccdc652dfc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= p...@draigbrady.com Date: Thu, 13 Jan 2011 09:36:38 + Subject: [PATCH] maint: trivial system header file cleanups * src/system.h: Note where it should be included, and make ordering

Re: [coreutils] basename/dirname can't handle stdin?

2011-01-13 Thread Jeff Blaine
So then, please review. One question at the bottom. # Most basic usage basename /foo/bar.txt = bar.txt # Old/current basename NAME SUFFIX compat- # ibility basename /foo/bar.txt .txt = bar # ERROR, one too many operands basename

Re: [coreutils] basename/dirname can't handle stdin?

2011-01-13 Thread Jeff Blaine
On 1/12/2011 3:09 PM, Bob Proulx wrote: This also fails: find /somewhere -print | xargs basename Why did that fail? Are you also getting an error message from find? [jblaine@new-host src]$ find /home/jblaine -mtime -1 -print /home/jblaine /home/jblaine/.gconf /home/jblaine/.gconf/apps

Re: [coreutils] basename/dirname can't handle stdin?

2011-01-13 Thread Eric Blake
On 01/13/2011 04:15 PM, Jeff Blaine wrote: So then, please review. One question at the bottom. # Most basic usage basename /foo/bar.txt = bar.txt # Old/current basename NAME SUFFIX compat- # ibility basename /foo/bar.txt .txt =

Re: [coreutils] basename/dirname can't handle stdin?

2011-01-13 Thread Pádraig Brady
On 13/01/11 23:15, Jeff Blaine wrote: So then, please review. One question at the bottom. # Most basic usage basename /foo/bar.txt = bar.txt # Old/current basename NAME SUFFIX compat- # ibility basename /foo/bar.txt .txt = bar

Re: [coreutils] basename/dirname can't handle stdin?

2011-01-13 Thread Eric Blake
On 01/13/2011 04:53 PM, Pádraig Brady wrote: It would be nice not to mandate it, but without it a script containing the following for example could hang: path=$(basename $path 2/dev/null || echo default_path) Perhaps we should only support --files0-from and the normal filtering case can

Re: [coreutils] basename/dirname can't handle stdin?

2011-01-13 Thread Pádraig Brady
On 14/01/11 00:02, Eric Blake wrote: On 01/13/2011 04:53 PM, Pádraig Brady wrote: So in summary, just implement -a and -s like BSD does? I think you've persuaded me that a filter mode doesn't buy us much (it's only useful if unambiguous, but xargs -0 works just as well at giving us

[coreutils] another potential sort bug?

2011-01-13 Thread Eric Blake
POSIX is explicit that in a multi-threaded app, use of any non-async-signal-safe function in between fork() and exec*()/exit() may result in undefined behavior. For example, if thread 1 is in the middle of a malloc() and holds a mutex, and thread 2 calls fork(), then any attempt by the child