1 diff -urN ndisc6-0.9.8/rdnssd/Makefile.am ndisc6-0.9.8.new/rdnssd/Makefile.am
2 --- ndisc6-0.9.8/rdnssd/Makefile.am 2008-05-01 14:52:28.000000000 +0200
3 +++ ndisc6-0.9.8.new/rdnssd/Makefile.am 2009-04-17 15:47:51.000000000 +0200
6 rdnssd_SOURCES = rdnssd.c rdnssd.h \
11 rdnssd_LDADD = $(LIBRT) \
12 @top_builddir@/compat/libcompat.a
14 diff -urN ndisc6-0.9.8/rdnssd/Makefile.in ndisc6-0.9.8.new/rdnssd/Makefile.in
15 --- ndisc6-0.9.8/rdnssd/Makefile.in 2008-05-01 14:52:45.000000000 +0200
16 +++ ndisc6-0.9.8.new/rdnssd/Makefile.in 2009-04-17 15:47:39.000000000 +0200
18 am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(confdir)"
19 sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
20 PROGRAMS = $(sbin_PROGRAMS)
21 -am_rdnssd_OBJECTS = rdnssd.$(OBJEXT) icmp.$(OBJEXT) netlink.$(OBJEXT)
22 +am_rdnssd_OBJECTS = rdnssd.$(OBJEXT) icmp.$(OBJEXT) netlink.$(OBJEXT) strverscmp.$(OBJEXT)
23 rdnssd_OBJECTS = $(am_rdnssd_OBJECTS)
25 rdnssd_DEPENDENCIES = $(am__DEPENDENCIES_1) \
28 rdnssd_SOURCES = rdnssd.c rdnssd.h \
34 rdnssd_LDADD = $(LIBRT) \
35 @top_builddir@/compat/libcompat.a
38 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icmp.Po@am__quote@
39 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink.Po@am__quote@
40 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strverscmp.Po@am__quote@
41 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdnssd.Po@am__quote@
44 diff -urN ndisc6-0.9.8/rdnssd/strverscmp.c ndisc6-0.9.8.new/rdnssd/strverscmp.c
45 --- ndisc6-0.9.8/rdnssd/strverscmp.c 1970-01-01 01:00:00.000000000 +0100
46 +++ ndisc6-0.9.8.new/rdnssd/strverscmp.c 2009-04-17 15:46:24.000000000 +0200
48 +/* Compare strings while treating digits characters numerically.
49 + Copyright (C) 1997, 2000, 2002, 2004 Free Software Foundation, Inc.
50 + This file is part of the GNU C Library.
51 + Contributed by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>, 1997.
53 + This program is free software; you can redistribute it and/or modify
54 + it under the terms of the GNU General Public License as published by
55 + the Free Software Foundation; either version 2, or (at your option)
58 + This program is distributed in the hope that it will be useful,
59 + but WITHOUT ANY WARRANTY; without even the implied warranty of
60 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
61 + GNU General Public License for more details.
63 + You should have received a copy of the GNU General Public License along
64 + with this program; if not, write to the Free Software Foundation,
65 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
74 +/* states: S_N: normal, S_I: comparing integral part, S_F: comparing
75 + fractional parts, S_Z: idem but with leading Zeroes only */
81 +/* result_type: CMP: return diff; LEN: compare using len_diff/diff */
86 +/* ISDIGIT differs from isdigit, as follows:
87 + - Its arg may be any int or unsigned int; it need not be an unsigned char.
88 + - It's guaranteed to evaluate its argument exactly once.
89 + - It's typically faster.
90 + POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to
91 + ISDIGIT_LOCALE unless it's important to use the locale's definition
92 + of `digit' even when the host does not conform to POSIX. */
93 +#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
99 +# define __strverscmp strverscmp
102 +/* Compare S1 and S2 as strings holding indices/version numbers,
103 + returning less than, equal to or greater than zero if S1 is less than,
104 + equal to or greater than S2 (for more info, see the texinfo doc).
108 +__strverscmp (const char *s1, const char *s2)
110 + const unsigned char *p1 = (const unsigned char *) s1;
111 + const unsigned char *p2 = (const unsigned char *) s2;
112 + unsigned char c1, c2;
116 + /* Symbol(s) 0 [1-9] others (padding)
117 + Transition (10) 0 (01) d (00) x (11) - */
118 + static const unsigned int next_state[] =
120 + /* state x d 0 - */
121 + /* S_N */ S_N, S_I, S_Z, S_N,
122 + /* S_I */ S_N, S_I, S_I, S_I,
123 + /* S_F */ S_N, S_F, S_F, S_F,
124 + /* S_Z */ S_N, S_F, S_Z, S_Z
127 + static const int result_type[] =
129 + /* state x/x x/d x/0 x/- d/x d/d d/0 d/-
130 + 0/x 0/d 0/0 0/- -/x -/d -/0 -/- */
132 + /* S_N */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP,
133 + CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP,
134 + /* S_I */ CMP, -1, -1, CMP, 1, LEN, LEN, CMP,
135 + 1, LEN, LEN, CMP, CMP, CMP, CMP, CMP,
136 + /* S_F */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP,
137 + CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP,
138 + /* S_Z */ CMP, 1, 1, CMP, -1, CMP, CMP, CMP,
147 + /* Hint: '0' is a digit too. */
148 + state = S_N | ((c1 == '0') + (ISDIGIT (c1) != 0));
150 + while ((diff = c1 - c2) == 0 && c1 != '\0')
152 + state = next_state[state];
155 + state |= (c1 == '0') + (ISDIGIT (c1) != 0);
158 + state = result_type[state << 2 | ((c2 == '0') + (ISDIGIT (c2) != 0))];
166 + while (ISDIGIT (*p1++))
167 + if (!ISDIGIT (*p2++))
170 + return ISDIGIT (*p2) ? -1 : diff;
177 +weak_alias (__strverscmp, strverscmp)