From a9f51e430fef49b3299ec33c11a4e6623e3f58cc Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Wed, 11 Sep 2013 22:00:36 -0700 Subject: Merge git_buf and git_buffer This makes the git_buf struct that was used internally into an externally available structure and eliminates the git_buffer. As part of that, some of the special cases that arose with the externally used git_buffer were blended into the git_buf, such as being careful about git_buf objects that may have a NULL ptr and allowing for bufs with a valid ptr and size but zero asize as a way of referring to externally owned data. --- src/util.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index d0c326ae5..151782346 100644 --- a/src/util.c +++ b/src/util.c @@ -679,6 +679,9 @@ size_t git__unescape(char *str) { char *scan, *pos = str; + if (!str) + return 0; + for (scan = str; *scan; pos++, scan++) { if (*scan == '\\' && *(scan + 1) != '\0') scan++; /* skip '\' but include next char */ -- cgit v1.2.1