forked from enlightenment/efl
Small fix on entry load file
In case a file can't be completely read, return what could be read so far. SVN revision: 54152
This commit is contained in:
parent
24b7f9bcaa
commit
c7005dd59b
|
@ -271,8 +271,11 @@ _load_file(const char *file)
|
|||
if (!f) return NULL;
|
||||
while ((size = fread(buf, 1, sizeof(buf), f)))
|
||||
{
|
||||
char *tmp_text;
|
||||
buf[size] = 0;
|
||||
text = _buf_append(text, buf, &len, &alloc);
|
||||
tmp_text = _buf_append(text, buf, &len, &alloc);
|
||||
if (!tmp_text) break;
|
||||
text = tmp_text;
|
||||
}
|
||||
fclose(f);
|
||||
return text;
|
||||
|
|
Loading…
Reference in New Issue