Simplify calling of CR/LF conversion routines

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Alex Riesen
2007-04-19 02:05:03 +02:00
committed by Junio C Hamano
parent 88e7fdf2cb
commit ac78e54804
6 changed files with 51 additions and 60 deletions

View File

@ -2277,10 +2277,9 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object,
*/
if ((type == OBJ_BLOB) && S_ISREG(st->st_mode)) {
unsigned long nsize = size;
char *nbuf = buf;
if (convert_to_git(path, &nbuf, &nsize)) {
if (size)
munmap(buf, size);
char *nbuf = convert_to_git(path, buf, &nsize);
if (nbuf) {
munmap(buf, size);
size = nsize;
buf = nbuf;
re_allocated = 1;