Very old versions for history.
[opsoft_archive.git] / silentbob / silent_bob-1.2 / src / sblib / ww_last_word.cpp
blob9004dfb862806afed9b92f18190e71ae03f01e0d
1 /*
2 * (c) Oleg Puchinin 2006.
3 * graycardinalster@gmail.com
5 */
7 #include "../head.h"
9 char * ww_last_word (char *d_op)
11 char * S = d_op;
12 char * d_word;
14 while (*S) {
15 if (*S == '(' || *S == '=' || *S == '[')
16 break;
17 S++;
20 if (S[-1] == ' ')
21 S--;
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;
32 while (*d_word == '*' ||
33 *d_word == '&' ||
34 *d_word == ' ')
35 d_word++;
37 return d_word;