GNU bug report logs - #9085
'split' feature request: an option to uses e.g. '.001' as first suffix.

Previous Next

Package: coreutils;

Reported by: SciFi <sci-fi <at> hush.ai>

Date: Thu, 14 Jul 2011 22:35:02 UTC

Severity: wishlist

Merged with 11004

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #44 received at 9085 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Jérémy Compostella
 <jeremy.compostella <at> gmail.com>
Cc: 9085 <at> debbugs.gnu.org, Jim Meyering <jim <at> meyering.net>, coreutils <at> gnu.org
Subject: Re: bug#9085: 'split' feature request: an option to uses e.g. '.001'
	as first suffix.
Date: Fri, 17 Feb 2012 02:13:13 +0000
[Message part 1 (text/plain, inline)]
On 02/16/2012 09:30 PM, Jérémy Compostella wrote:
> Pádraig, all,
> 
> I rebased my branch for this feature and make the syntax-check
> success. I attached the new patch which I hope will satisfy you.
> 
> Feel free to comment it, I will take into account whatever you want.

Thanks for continuing with this.
One general thing that might both improve
and simplify the implementation, is to
not to convert from string to int at all.

I.E. when processing the arg, just validate like:
if (strlen (optarg) != strspn (optarg, suffix_alphabet))
  error()
else
   /* skip over any leading 0, and use this as the start directly. */

Then the subsequent check for length and
the initialization of the file name should be simplified.

Also this removes the limitation of size of an unsigned int,
though that's not really a practical concern I suppose.

I've also attached some string and test cleanups,
to --amend into your patch.

cheers,
Pádraig.
[split-numeric-suffix-adjusments.diff (text/plain, attachment)]

This bug report was last modified 13 years and 129 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.