forked from github/server
remove whitespace eating from parse_order.
This commit is contained in:
parent
6bf2ac34e3
commit
778f487afa
1 changed files with 14 additions and 17 deletions
|
@ -386,35 +386,32 @@ order *parse_order(const char *s, const struct locale * lang)
|
||||||
{
|
{
|
||||||
assert(lang);
|
assert(lang);
|
||||||
assert(s);
|
assert(s);
|
||||||
while (*s && !isalnum(*(unsigned char *)s) && !ispunct(*(unsigned char *)s)) {
|
|
||||||
++s;
|
|
||||||
}
|
|
||||||
if (*s != 0) {
|
if (*s != 0) {
|
||||||
keyword_t kwd;
|
keyword_t kwd = NOKEYWORD;
|
||||||
const char *sptr;
|
const char *sptr = s;
|
||||||
bool persistent = false, noerror = false;
|
bool persistent = false, noerror = false;
|
||||||
const char * p;
|
const char * p;
|
||||||
|
|
||||||
while (*s == '!' || *s=='@') {
|
|
||||||
if (*s=='!') noerror = true;
|
|
||||||
else if (*s == '@') persistent = true;
|
|
||||||
++s;
|
|
||||||
}
|
|
||||||
sptr = s;
|
|
||||||
p = *sptr ? parse_token_depr(&sptr) : 0;
|
p = *sptr ? parse_token_depr(&sptr) : 0;
|
||||||
kwd = p ? get_keyword(p, lang) : NOKEYWORD;
|
if (p) {
|
||||||
|
while (*p == '!' || *p == '@') {
|
||||||
|
if (*p == '!') noerror = true;
|
||||||
|
else if (*p == '@') persistent = true;
|
||||||
|
++p;
|
||||||
|
}
|
||||||
|
kwd = get_keyword(p, lang);
|
||||||
|
}
|
||||||
if (kwd == K_MAKE) {
|
if (kwd == K_MAKE) {
|
||||||
const char *s, *sp = sptr;
|
const char *sp = sptr;
|
||||||
s = parse_token_depr(&sp);
|
p = parse_token_depr(&sp);
|
||||||
if (s && isparam(s, lang, P_TEMP)) {
|
if (p && isparam(p, lang, P_TEMP)) {
|
||||||
kwd = K_MAKETEMP;
|
kwd = K_MAKETEMP;
|
||||||
sptr = sp;
|
sptr = sp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (kwd != NOKEYWORD) {
|
if (kwd != NOKEYWORD) {
|
||||||
while (isspace(*(unsigned char *)sptr)) ++sptr;
|
while (isspace(*(unsigned char *)sptr)) ++sptr;
|
||||||
s = sptr;
|
return create_order_i(kwd, sptr, persistent, noerror, lang);
|
||||||
return create_order_i(kwd, s, persistent, noerror, lang);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue