Fix environment variable parser to exit early
This commit is contained in:
parent
8b8f6a2b3f
commit
41c0a4c2da
2 changed files with 6 additions and 2 deletions
|
@ -120,6 +120,10 @@ uint8_t gargoyle_digest_envh(uint16_t optc, struct gargoyle_opt *optv, const cha
|
||||||
} else {
|
} else {
|
||||||
res = gargoyle_from_rope(opt, brand + opt->brand_sz + 1, flags);
|
res = gargoyle_from_rope(opt, brand + opt->brand_sz + 1, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(res) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -9,7 +9,7 @@ uint8_t gargoyle_from_bool(struct gargoyle_opt *opt, const char *brand, const ch
|
||||||
*val = !gargoyle_cmp(brand, neg, neg_sz, flags);
|
*val = !gargoyle_cmp(brand, neg, neg_sz, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return GARGOYLE_ERR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t gargoyle_from_rope(struct gargoyle_opt *opt, const char *brand_val, gargoyle_flag_type flags) {
|
uint8_t gargoyle_from_rope(struct gargoyle_opt *opt, const char *brand_val, gargoyle_flag_type flags) {
|
||||||
|
@ -36,5 +36,5 @@ uint8_t gargoyle_from_rope(struct gargoyle_opt *opt, const char *brand_val, garg
|
||||||
return GARGOYLE_ERR_UNKNOWN_TYPE;
|
return GARGOYLE_ERR_UNKNOWN_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return GARGOYLE_ERR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue