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

Side by Side Diff: nspr/lib/libc/src/strtok.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/strstr.c ('k') | nspr/pr/include/md/_darwin.h » ('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
8 PR_IMPLEMENT(char *)
9 PL_strtok_r(char *s1, const char *s2, char **lasts)
10 {
11 const char *sepp;
12 int c, sc;
13 char *tok;
14
15 if( s1 == NULL )
16 {
17 if( *lasts == NULL )
18 return NULL;
19
20 s1 = *lasts;
21 }
22
23 for( ; (c = *s1) != 0; s1++ )
24 {
25 for( sepp = s2 ; (sc = *sepp) != 0 ; sepp++ )
26 {
27 if( c == sc )
28 break;
29 }
30 if( sc == 0 )
31 break;
32 }
33
34 if( c == 0 )
35 {
36 *lasts = NULL;
37 return NULL;
38 }
39
40 tok = s1++;
41
42 for( ; (c = *s1) != 0; s1++ )
43 {
44 for( sepp = s2; (sc = *sepp) != 0; sepp++ )
45 {
46 if( c == sc )
47 {
48 *s1++ = '\0';
49 *lasts = s1;
50 return tok;
51 }
52 }
53 }
54 *lasts = NULL;
55 return tok;
56 }
OLDNEW
« no previous file with comments | « nspr/lib/libc/src/strstr.c ('k') | nspr/pr/include/md/_darwin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698