Fix environment variable parser to exit early

This commit is contained in:
Nick Chambers 2022-06-28 20:42:32 -05:00
parent 8b8f6a2b3f
commit 41c0a4c2da
2 changed files with 6 additions and 2 deletions

View File

@ -120,6 +120,10 @@ uint8_t gargoyle_digest_envh(uint16_t optc, struct gargoyle_opt *optv, const cha
} else {
res = gargoyle_from_rope(opt, brand + opt->brand_sz + 1, flags);
}
if(res) {
return res;
}
}
return 0;

View File

@ -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);
}
return 0;
return GARGOYLE_ERR_SUCCESS;
}
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 0;
return GARGOYLE_ERR_SUCCESS;
}