mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-31 02:18:08 +00:00
- Update 'tests-clar/resources/config/config11' in order to reproduce the invalidread with the unittest (just added some \n at the end of the file)
- Fix config_file.c
This commit is contained in:
parent
8ff2b0c759
commit
bcad677ba8
@ -924,7 +924,7 @@ static int strip_comments(char *line, int in_quotes)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* skip any space at the end */
|
/* skip any space at the end */
|
||||||
if (git__isspace(ptr[-1])) {
|
if (ptr > line && git__isspace(ptr[-1])) {
|
||||||
ptr--;
|
ptr--;
|
||||||
}
|
}
|
||||||
ptr[0] = '\0';
|
ptr[0] = '\0';
|
||||||
@ -1398,7 +1398,7 @@ static int parse_variable(diskfile_backend *cfg, char **var_name, char **var_val
|
|||||||
value_start = var_end + 1;
|
value_start = var_end + 1;
|
||||||
|
|
||||||
do var_end--;
|
do var_end--;
|
||||||
while (git__isspace(*var_end));
|
while (var_end>line && git__isspace(*var_end));
|
||||||
|
|
||||||
*var_name = git__strndup(line, var_end - line + 1);
|
*var_name = git__strndup(line, var_end - line + 1);
|
||||||
GITERR_CHECK_ALLOC(*var_name);
|
GITERR_CHECK_ALLOC(*var_name);
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
[remote "fancy"]
|
[remote "fancy"]
|
||||||
url = git://github.com/libgit2/libgit2
|
url = git://github.com/libgit2/libgit2
|
||||||
url = git://git.example.com/libgit2
|
url = git://git.example.com/libgit2
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user