Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: nspr/lib/libc/src/strpbrk.c

Issue 2078763002: Delete bundled copy of NSS and replace with README. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/nss@master
Patch Set: Delete bundled copy of NSS and replace with README. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « nspr/lib/libc/src/strlen.c ('k') | nspr/lib/libc/src/strstr.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 #include "plstr.h"
7 #include <string.h>
8
9 PR_IMPLEMENT(char *)
10 PL_strpbrk(const char *s, const char *list)
11 {
12 if( ((const char *)0 == s) || ((const char *)0 == list) ) return (char *)0;
13
14 return strpbrk(s, list);
15 }
16
17 PR_IMPLEMENT(char *)
18 PL_strprbrk(const char *s, const char *list)
19 {
20 const char *p;
21 const char *r;
22
23 if( ((const char *)0 == s) || ((const char *)0 == list) ) return (char *)0;
24
25 for( r = s; *r; r++ )
26 ;
27
28 for( r--; r >= s; r-- )
29 for( p = list; *p; p++ )
30 if( *r == *p )
31 return (char *)r;
32
33 return (char *)0;
34 }
35
36 PR_IMPLEMENT(char *)
37 PL_strnpbrk(const char *s, const char *list, PRUint32 max)
38 {
39 const char *p;
40
41 if( ((const char *)0 == s) || ((const char *)0 == list) ) return (char *)0;
42
43 for( ; max && *s; s++, max-- )
44 for( p = list; *p; p++ )
45 if( *s == *p )
46 return (char *)s;
47
48 return (char *)0;
49 }
50
51 PR_IMPLEMENT(char *)
52 PL_strnprbrk(const char *s, const char *list, PRUint32 max)
53 {
54 const char *p;
55 const char *r;
56
57 if( ((const char *)0 == s) || ((const char *)0 == list) ) return (char *)0;
58
59 for( r = s; max && *r; r++, max-- )
60 ;
61
62 for( r--; r >= s; r-- )
63 for( p = list; *p; p++ )
64 if( *r == *p )
65 return (char *)r;
66
67 return (char *)0;
68 }
OLDNEW
« no previous file with comments | « nspr/lib/libc/src/strlen.c ('k') | nspr/lib/libc/src/strstr.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698