~ubuntu-branches/ubuntu/precise/nspr/precise-proposed

« back to all changes in this revision

Viewing changes to mozilla/nsprpub/lib/libc/src/strcstr.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
 
PR_IMPLEMENT(char *)
41
 
PL_strcasestr(const char *big, const char *little)
42
 
{
43
 
    PRUint32 ll;
44
 
 
45
 
    if( ((const char *)0 == big) || ((const char *)0 == little) ) return (char *)0;
46
 
    if( ((char)0 == *big) || ((char)0 == *little) ) return (char *)0;
47
 
 
48
 
    ll = PL_strlen(little);
49
 
 
50
 
    for( ; *big; big++ )
51
 
        /* obvious improvement available here */
52
 
            if( 0 == PL_strncasecmp(big, little, ll) )
53
 
                return (char *)big;
54
 
 
55
 
    return (char *)0;
56
 
}
57
 
 
58
 
PR_IMPLEMENT(char *)
59
 
PL_strcaserstr(const char *big, const char *little)
60
 
{
61
 
    const char *p;
62
 
    PRUint32 bl, ll;
63
 
 
64
 
    if( ((const char *)0 == big) || ((const char *)0 == little) ) return (char *)0;
65
 
    if( ((char)0 == *big) || ((char)0 == *little) ) return (char *)0;
66
 
 
67
 
    bl = PL_strlen(big);
68
 
    ll = PL_strlen(little);
69
 
    if( bl < ll ) return (char *)0;
70
 
    p = &big[ bl - ll ];
71
 
 
72
 
    for( ; p >= big; p-- )
73
 
        /* obvious improvement available here */
74
 
            if( 0 == PL_strncasecmp(p, little, ll) )
75
 
                return (char *)p;
76
 
 
77
 
    return (char *)0;
78
 
}
79
 
 
80
 
PR_IMPLEMENT(char *)
81
 
PL_strncasestr(const char *big, const char *little, PRUint32 max)
82
 
{
83
 
    PRUint32 ll;
84
 
 
85
 
    if( ((const char *)0 == big) || ((const char *)0 == little) ) return (char *)0;
86
 
    if( ((char)0 == *big) || ((char)0 == *little) ) return (char *)0;
87
 
 
88
 
    ll = PL_strlen(little);
89
 
    if( ll > max ) return (char *)0;
90
 
    max -= ll;
91
 
    max++;
92
 
 
93
 
    for( ; max && *big; big++, max-- )
94
 
        /* obvious improvement available here */
95
 
            if( 0 == PL_strncasecmp(big, little, ll) )
96
 
                return (char *)big;
97
 
 
98
 
    return (char *)0;
99
 
}
100
 
 
101
 
PR_IMPLEMENT(char *)
102
 
PL_strncaserstr(const char *big, const char *little, PRUint32 max)
103
 
{
104
 
    const char *p;
105
 
    PRUint32 ll;
106
 
 
107
 
    if( ((const char *)0 == big) || ((const char *)0 == little) ) return (char *)0;
108
 
    if( ((char)0 == *big) || ((char)0 == *little) ) return (char *)0;
109
 
 
110
 
    ll = PL_strlen(little);
111
 
 
112
 
    for( p = big; max && *p; p++, max-- )
113
 
        ;
114
 
 
115
 
    p -= ll;
116
 
    if( p < big ) return (char *)0;
117
 
 
118
 
    for( ; p >= big; p-- )
119
 
        /* obvious improvement available here */
120
 
            if( 0 == PL_strncasecmp(p, little, ll) )
121
 
                return (char *)p;
122
 
 
123
 
    return (char *)0;
124
 
}