diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-10-05 12:30:18 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-10-05 12:30:18 -0700 |
commit | 8a54523f0f70134327e7b2a625b1777c796b07d5 (patch) | |
tree | 865f7cecea7f994e194066d76498933214490cf0 /git-compat-util.h | |
parent | 416e2b3d4bcc4ba4b6dc8fafa954fcfdec4fc72d (diff) | |
parent | 5242860f548d1869ac2779726ad496f0ae8ab5ca (diff) | |
download | git-8a54523f0f70134327e7b2a625b1777c796b07d5.tar.gz |
Merge branch 'kn/for-each-tag'
The "ref-filter" code was taught about many parts of what "tag -l"
does and then "tag -l" is being reimplemented in terms of "ref-filter".
* kn/for-each-tag:
tag.c: implement '--merged' and '--no-merged' options
tag.c: implement '--format' option
tag.c: use 'ref-filter' APIs
tag.c: use 'ref-filter' data structures
ref-filter: add option to match literal pattern
ref-filter: add support to sort by version
ref-filter: add support for %(contents:lines=X)
ref-filter: add option to filter out tags, branches and remotes
ref-filter: implement an `align` atom
ref-filter: introduce match_atom_name()
ref-filter: introduce handler function for each atom
utf8: add function to align a string into given strbuf
ref-filter: introduce ref_formatting_state and ref_formatting_stack
ref-filter: move `struct atom_value` to ref-filter.c
strtoul_ui: reject negative values
Diffstat (limited to 'git-compat-util.h')
-rw-r--r-- | git-compat-util.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index f649e81f11..1df82fa598 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -814,6 +814,9 @@ static inline int strtoul_ui(char const *s, int base, unsigned int *result) char *p; errno = 0; + /* negative values would be accepted by strtoul */ + if (strchr(s, '-')) + return -1; ul = strtoul(s, &p, base); if (errno || *p || p == s || (unsigned int) ul != ul) return -1; |