Change the include order of archive_string.h and archive_prviate.h.
[dragonfly.git] / lib / libarchive / patches / archive_string.c.patch
1 $DragonFly: src/lib/libarchive/patches/Attic/archive_string.c.patch,v 1.2 2004/11/24 10:20:45 joerg Exp $
2
3 Index: archive_string.c
4 ===================================================================
5 RCS file: /home/ncvs/src/lib/libarchive/archive_string.c,v
6 retrieving revision 1.5
7 diff -u -r1.5 archive_string.c
8 --- archive_string.c    14 Aug 2004 03:45:45 -0000      1.5
9 +++ archive_string.c    11 Nov 2004 06:54:41 -0000
10 @@ -35,8 +35,8 @@
11  #include <stdlib.h>
12  #include <string.h>
13  
14 -#include "archive_private.h"
15  #include "archive_string.h"
16 +#include "archive_private.h"
17  
18  struct archive_string *
19  __archive_string_append(struct archive_string *as, const char *p, size_t s)
20 @@ -96,3 +96,18 @@
21  {
22         return (__archive_string_append(as, &c, 1));
23  }
24 +
25 +struct archive_string *
26 +__archive_strappend_int(struct archive_string *as, int d, int base)
27 +{
28 +       static const char *digits = "0123457890abcdef";
29 +
30 +       if (d < 0) {
31 +               __archive_strappend_char(as, '-');
32 +               d = -d;
33 +       }
34 +       if (d >= base)
35 +               __archive_strappend_int(as, d/base, base);
36 +       __archive_strappend_char(as, digits[d % base]);
37 +       return (as);
38 +}