~ubuntu-branches/ubuntu/quantal/nspr/quantal-security

« back to all changes in this revision

Viewing changes to mozilla/nsprpub/lib/libc/src/strccmp.c

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack, Fabien Tassin, Alexander Sack
  • Date: 2009-01-11 13:50:07 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090111135007-butxlx6upwjcakod
Tags: 4.7.3-0ubuntu1
* New upstream version: 4.7.3 from NSPR_4_7_3_RTM tag

[ Fabien Tassin <fta@ubuntu.com> ]
* LP: #269188 - use /dev/urandom for better entropy on LTSP environments
* update diverged patches:
  - update debian/patches/30_pkgconfig.patch
  - update debian/patches/81_sonames.patch
  - update debian/patches/99_configure.patch

[ Alexander Sack <asac@ubuntu.com> ]
Drop debian soname patch for full upstream compatibility
* eliminate soname patch
  - delete debian/patches/81_sonames.patch
  - update debian/patches/series
* refresh configure patch to reflect dropped soname patch
  - update debian/patches/99_configure.patch
* install unversioned .so files
  - update debian/libnspr4-0d.install
* .so.0d links are not created without the soname patch. we create
  backlinks to the unversioned .so libs using debhelper; also we
  cannot dh_install the .0d versioned libs anymore and we drop
  them from .install accordingly
  - add debian/libnspr4-0d.links
  - update debian/libnspr4-0d.install
* implement link shuffeling transition (with abort cases) in
  maintainer scripts; affected libs: libnspr4.so libplc4.so libplds4.so
  - add debian/libnspr4-0d.postinst
  - add debian/libnspr4-0d.postrm
  - add debian/libnspr4-0d.preinst
  - add debian/libnspr4-0d.prerm
* drop soname version suffix from symbol files and reflect this fact by
  adjusting minimum version to this package version (4.7.3-0ubuntu1~)
  - update debian/libnspr4-0d.symbols
  - update debian/libnspr4-0d.symbols.amd64
  - update debian/libnspr4-0d.symbols.i386
  - update debian/libnspr4-0d.symbols.ia64
  - update debian/libnspr4-0d.symbols.lpia
  - update debian/libnspr4-0d.symbols.powerpc
* bump lower shlibs version constraint to 4.7.1+1.9-0ubuntu5~
  - update debian/rules
* rerun autoconf2.13 to apply dropped 81_sonames.patch to configure
  - update debian/patches/99_configure.patch
* explitly define libnspr4_0d_EXPORTED_LIBS and pass those manually
  to dpkg-gensymbols to workaround uncommon SONAME used by nspr libs
  - update debian/rules
* don't pretend to create shlibs-control file anymore; add binary
  lintian override for that
  - update debian/rules
* add #DEBHELPER# token to maintainer scripts
  - update debian/libnspr4-0d.postinst
  - update debian/libnspr4-0d.postrm
  - update debian/libnspr4-0d.preinst
  - update debian/libnspr4-0d.prerm

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
 
/* ***** BEGIN LICENSE BLOCK *****
3
 
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4
 
 *
5
 
 * The contents of this file are subject to the Mozilla Public License Version
6
 
 * 1.1 (the "License"); you may not use this file except in compliance with
7
 
 * the License. You may obtain a copy of the License at
8
 
 * http://www.mozilla.org/MPL/
9
 
 *
10
 
 * Software distributed under the License is distributed on an "AS IS" basis,
11
 
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
 
 * for the specific language governing rights and limitations under the
13
 
 * License.
14
 
 *
15
 
 * The Original Code is the Netscape Portable Runtime (NSPR).
16
 
 *
17
 
 * The Initial Developer of the Original Code is
18
 
 * Netscape Communications Corporation.
19
 
 * Portions created by the Initial Developer are Copyright (C) 1998-2000
20
 
 * the Initial Developer. All Rights Reserved.
21
 
 *
22
 
 * Contributor(s):
23
 
 *
24
 
 * Alternatively, the contents of this file may be used under the terms of
25
 
 * either the GNU General Public License Version 2 or later (the "GPL"), or
26
 
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
 
 * in which case the provisions of the GPL or the LGPL are applicable instead
28
 
 * of those above. If you wish to allow use of your version of this file only
29
 
 * under the terms of either the GPL or the LGPL, and not to allow others to
30
 
 * use your version of this file under the terms of the MPL, indicate your
31
 
 * decision by deleting the provisions above and replace them with the notice
32
 
 * and other provisions required by the GPL or the LGPL. If you do not delete
33
 
 * the provisions above, a recipient may use your version of this file under
34
 
 * the terms of any one of the MPL, the GPL or the LGPL.
35
 
 *
36
 
 * ***** END LICENSE BLOCK ***** */
37
 
 
38
 
#include "plstr.h"
39
 
 
40
 
static const unsigned char uc[] =
41
 
{
42
 
    '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
43
 
    '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
44
 
    '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
45
 
    '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
46
 
    ' ',    '!',    '"',    '#',    '$',    '%',    '&',    '\'',
47
 
    '(',    ')',    '*',    '+',    ',',    '-',    '.',    '/',
48
 
    '0',    '1',    '2',    '3',    '4',    '5',    '6',    '7',
49
 
    '8',    '9',    ':',    ';',    '<',    '=',    '>',    '?',
50
 
    '@',    'A',    'B',    'C',    'D',    'E',    'F',    'G',
51
 
    'H',    'I',    'J',    'K',    'L',    'M',    'N',    'O',
52
 
    'P',    'Q',    'R',    'S',    'T',    'U',    'V',    'W',
53
 
    'X',    'Y',    'Z',    '[',    '\\',   ']',    '^',    '_',
54
 
    '`',    'A',    'B',    'C',    'D',    'E',    'F',    'G',
55
 
    'H',    'I',    'J',    'K',    'L',    'M',    'N',    'O',
56
 
    'P',    'Q',    'R',    'S',    'T',    'U',    'V',    'W',
57
 
    'X',    'Y',    'Z',    '{',    '|',    '}',    '~',    '\177',
58
 
    0200,   0201,   0202,   0203,   0204,   0205,   0206,   0207,
59
 
    0210,   0211,   0212,   0213,   0214,   0215,   0216,   0217,
60
 
    0220,   0221,   0222,   0223,   0224,   0225,   0226,   0227,
61
 
    0230,   0231,   0232,   0233,   0234,   0235,   0236,   0237,
62
 
    0240,   0241,   0242,   0243,   0244,   0245,   0246,   0247,
63
 
    0250,   0251,   0252,   0253,   0254,   0255,   0256,   0257,
64
 
    0260,   0261,   0262,   0263,   0264,   0265,   0266,   0267,
65
 
    0270,   0271,   0272,   0273,   0274,   0275,   0276,   0277,
66
 
    0300,   0301,   0302,   0303,   0304,   0305,   0306,   0307,
67
 
    0310,   0311,   0312,   0313,   0314,   0315,   0316,   0317,
68
 
    0320,   0321,   0322,   0323,   0324,   0325,   0326,   0327,
69
 
    0330,   0331,   0332,   0333,   0334,   0335,   0336,   0337,
70
 
    0340,   0341,   0342,   0343,   0344,   0345,   0346,   0347,
71
 
    0350,   0351,   0352,   0353,   0354,   0355,   0356,   0357,
72
 
    0360,   0361,   0362,   0363,   0364,   0365,   0366,   0367,
73
 
    0370,   0371,   0372,   0373,   0374,   0375,   0376,   0377
74
 
};
75
 
 
76
 
PR_IMPLEMENT(PRIntn)
77
 
PL_strcasecmp(const char *a, const char *b)
78
 
{
79
 
    const unsigned char *ua = (const unsigned char *)a;
80
 
    const unsigned char *ub = (const unsigned char *)b;
81
 
 
82
 
    if( ((const char *)0 == a) || (const char *)0 == b ) 
83
 
        return (PRIntn)(a-b);
84
 
 
85
 
    while( (uc[*ua] == uc[*ub]) && ('\0' != *a) )
86
 
    {
87
 
        a++;
88
 
        ua++;
89
 
        ub++;
90
 
    }
91
 
 
92
 
    return (PRIntn)(uc[*ua] - uc[*ub]);
93
 
}
94
 
 
95
 
PR_IMPLEMENT(PRIntn)
96
 
PL_strncasecmp(const char *a, const char *b, PRUint32 max)
97
 
{
98
 
    const unsigned char *ua = (const unsigned char *)a;
99
 
    const unsigned char *ub = (const unsigned char *)b;
100
 
 
101
 
    if( ((const char *)0 == a) || (const char *)0 == b ) 
102
 
        return (PRIntn)(a-b);
103
 
 
104
 
    while( max && (uc[*ua] == uc[*ub]) && ('\0' != *a) )
105
 
    {
106
 
        a++;
107
 
        ua++;
108
 
        ub++;
109
 
        max--;
110
 
    }
111
 
 
112
 
    if( 0 == max ) return (PRIntn)0;
113
 
 
114
 
    return (PRIntn)(uc[*ua] - uc[*ub]);
115
 
}