fileio: fix verification on failure in write_string_file_full()
Fixes a bug introduced by 0ab5e2a4b4.
This commit is contained in:
+1
-1
@@ -380,7 +380,7 @@ fail:
|
||||
|
||||
/* OK, the operation failed, but let's see if the right contents in place already. If so, eat up the
|
||||
* error. */
|
||||
if (verify_file(fn, line, !(flags & WRITE_STRING_FILE_AVOID_NEWLINE) || (flags & WRITE_STRING_FILE_VERIFY_IGNORE_NEWLINE)) > 0)
|
||||
if (verify_file_at(dir_fd, fn, line, !(flags & WRITE_STRING_FILE_AVOID_NEWLINE) || (flags & WRITE_STRING_FILE_VERIFY_IGNORE_NEWLINE)) > 0)
|
||||
return 0;
|
||||
|
||||
return r;
|
||||
|
||||
@@ -90,9 +90,6 @@ static inline int read_full_stream(FILE *f, char **ret_contents, size_t *ret_siz
|
||||
}
|
||||
|
||||
int verify_file_at(int dir_fd, const char *fn, const char *blob, bool accept_extra_nl);
|
||||
static inline int verify_file(const char *fn, const char *blob, bool accept_extra_nl) {
|
||||
return verify_file_at(AT_FDCWD, fn, blob, accept_extra_nl);
|
||||
}
|
||||
|
||||
int script_get_shebang_interpreter(const char *path, char **ret);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user