GNU bug report logs -
#9085
'split' feature request: an option to uses e.g. '.001' as first suffix.
Previous Next
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
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
> 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.
This is more like my first implementation indeed. But since I didn't
know about the strspn() function the code was a little bit more complex
without converting to int.
I attached the new patch. I tried to make it as simple as possible but
feel free to comment.
> Also this removes the limitation of size of an unsigned int,
> though that's not really a practical concern I suppose.
Fair point. IMHO, even if it's not a really practical concern
it's stupid to have such an easy to avoid restriction.
> I've also attached some string and test cleanups,
> to --amend into your patch.
Applied.
Cheers,
Jérémy
[Message part 2 (text/html, inline)]
[0001-split-numeric-suffixes-new-optional-from-argument-bu.patch (text/x-patch, attachment)]
This bug report was last modified 13 years and 130 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.