diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2015-03-17 17:00:05 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-03-19 11:02:57 -0700 |
commit | dff71b5b62966109d7711d998e57b97485c76589 (patch) | |
tree | 76bc8ad711f97b6d70a689937083a5661d351f1d | |
parent | 039bbe6de8a2f7d381a1a1838089ee5f85215fb2 (diff) | |
download | git-dff71b5b62966109d7711d998e57b97485c76589.tar.gz |
write_subdirectory(): use convert_ui() for parsing mode
Use convert_ui() instead of strtoul_ui() when parsing tree entries'
modes. This tightens up the parsing a bit:
* Leading whitespace is no longer allowed
* '+' and '-' are no longer allowed
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | contrib/convert-objects/convert-objects.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/convert-objects/convert-objects.c b/contrib/convert-objects/convert-objects.c index f3b57bf1d2..4f484a4890 100644 --- a/contrib/convert-objects/convert-objects.c +++ b/contrib/convert-objects/convert-objects.c @@ -1,4 +1,5 @@ #include "cache.h" +#include "numparse.h" #include "blob.h" #include "commit.h" #include "tree.h" @@ -88,7 +89,7 @@ static int write_subdirectory(void *buffer, unsigned long size, const char *base unsigned int mode; char *slash, *origpath; - if (!path || strtoul_ui(buffer, 8, &mode)) + if (!path || convert_ui(buffer, 8, &mode)) die("bad tree conversion"); mode = convert_mode(mode); path++; |