X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=src%2Fparser.c;h=c8120cd31175f8a1f6b333b25bd33c2297e4c10b;hb=c6516c715699de465423de60089efee1ec5857e1;hp=c04faccf8ec2af3801698aa9959442908854eedd;hpb=a1d883fc5b7acbf45fdc80a7806b4d4c21fdcd1f;p=smdp.git diff --git a/src/parser.c b/src/parser.c index c04facc..c8120cd 100644 --- a/src/parser.c +++ b/src/parser.c @@ -501,6 +501,13 @@ int next_nonblank(cstring_t *text, int i) { return i; } +int prev_blank(cstring_t *text, int i) { + while ((i > 0) && !isspace((unsigned char) (text->text)[i])) + i--; + + return i; +} + int next_blank(cstring_t *text, int i) { while ((i < text->size) && !isspace((unsigned char) (text->text)[i])) i++;