[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9085: 'split' feature request: an option to uses e.g. '.001' as firs

From: Pádraig Brady
Subject: bug#9085: 'split' feature request: an option to uses e.g. '.001' as first suffix.
Date: Fri, 17 Feb 2012 02:13:13 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0

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))
   /* 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.


Attachment: split-numeric-suffix-adjusments.diff
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]