emerald-gcc/patches/gcc/12.1.0/libcpp-files.c.patch

19 lines
555 B
Diff

--- libcpp/files.c.bak 2022-04-26 16:05:45.106981389 +1000
+++ libcpp/files.c 2022-04-26 16:08:09.492877252 +1000
@@ -742,11 +742,14 @@
cpp_error_at (pfile, CPP_DL_WARNING, loc,
"%s is shorter than expected", file->path);
+ off_t ot = (off_t) &file->st.st_size;
file->buffer = _cpp_convert_input (pfile,
CPP_OPTION (pfile, input_charset),
buf, size + 16, total,
&file->buffer_start,
- &file->st.st_size);
+ &ot);
+
+ file->st.st_size = ot;
file->buffer_valid = true;
return true;