repo.or.cz
/
opsoft_archive.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Very old versions for history.
[opsoft_archive.git]
/
silentbob
/
silent_bob-1.2
/
src
/
sblib
/
ww_last_word.cpp
blob
9004dfb862806afed9b92f18190e71ae03f01e0d
1
/*
2
* (c) Oleg Puchinin 2006.
3
* graycardinalster@gmail.com
4
*
5
*/
6
7
#include
"../head.h"
8
9
char
*
ww_last_word
(
char
*
d_op
)
10
{
11
char
*
S
=
d_op
;
12
char
*
d_word
;
13
14
while
(*
S
) {
15
if
(*
S
==
'('
|| *
S
==
'='
|| *
S
==
'['
)
16
break
;
17
S
++;
18
}
19
20
if
(
S
[-
1
] ==
' '
)
21
S
--;
22
23
*
S
=
0
;
24
d_word
=
d_op
;
25
while
(
true
) {
26
S
=
strchr
(
d_word
,
' '
);
27
if
(
S
==
NULL
)
28
break
;
29
d_word
=
S
+
1
;
30
}
31
32
while
(*
d_word
==
'*'
||
33
*
d_word
==
'&'
||
34
*
d_word
==
' '
)
35
d_word
++;
36
37
return
d_word
;
38
}
39