Very old versions for history.
[opsoft_archive.git] / silentbob / silent_bob-1.2 / src / sblib / ww_begin_offset.cpp
blobc82e3705dd542eff76d208c275ae6b7297fbd3d3
1 /*
2 * (c) Oleg Puchinin 2006.
3 * graycardinalster@gmail.com
5 */
7 #include "../head.h"
8 #include "../the_tt.h"
10 char * ww_begin_offset (struct tt_state_t * d_tt_state, char *d_out, int d_offset)
12 char *S = &d_tt_state->d_file_in [d_offset] - 1;
13 char * d_real = &d_out[strlen (d_out)] - 1;
15 while (d_real != d_out) {
16 if (*d_real == ' ' || *d_real == '\t') {
17 while (*S == ' ' || *S == '\t')
18 S--;
20 while ((*d_real == ' ' || *d_real == '\t')
21 && (d_real != d_out))
22 --d_real;
24 continue;
27 if (*S == *d_real)
28 --d_real;
30 --S;
33 return S;