repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git]
/
old-autovect-branch
/
gcc
/
testsuite
/
gcc.c-torture
/
execute
/
builtins
/
lib
/
strstr.c
blob
d803f1ee94bf7812dee00dc5de9d38f905cc7148
1
extern
void
abort
(
void
);
2
extern
int
inside_main
;
3
4
char
*
5
strstr
(
const char
*
s1
,
const char
*
s2
)
6
{
7
const char
*
p
, *
q
;
8
9
#ifdef __OPTIMIZE__
10
if
(
inside_main
)
11
abort
();
12
#endif
13
14
/* deliberately dumb algorithm */
15
for
(; *
s1
;
s1
++)
16
{
17
p
=
s1
,
q
=
s2
;
18
while
(*
q
&& *
p
)
19
{
20
if
(*
q
!= *
p
)
21
break
;
22
p
++,
q
++;
23
}
24
if
(*
q
==
0
)
25
return
(
char
*)
s1
;
26
}
27
return
0
;
28
}