commit - ed7cc4a82151aea060ad46169c957da2f37a8948
commit + 00fe21f262ab567bb792120514b49b37236c5422
blob - 9e4617d2d22bb0cc089b03f64f1d2bca3d19ab51
blob + 3ed755af645b180970e90d42b138fb2269beb206
--- got/got.c
+++ got/got.c
return got_error_from_errno("malloc");
(*logmsg)[0] = '\0';
- fp = fopen(logmsg_path, "r");
+ fp = fopen(logmsg_path, "re");
if (fp == NULL) {
err = got_error_from_errno("fopen");
goto done;
err = got_error_from_errno("got_repo_get_path_gotconfig");
goto done;
}
- gotconfig_file = fopen(gotconfig_path, "a");
+ gotconfig_file = fopen(gotconfig_path, "ae");
if (gotconfig_file == NULL) {
err = got_error_from_errno2("fopen", gotconfig_path);
goto done;
err = got_error_from_errno("got_repo_get_path_gitconfig");
goto done;
}
- gitconfig_file = fopen(gitconfig_path, "a");
+ gitconfig_file = fopen(gitconfig_path, "ae");
if (gitconfig_file == NULL) {
err = got_error_from_errno2("fopen", gitconfig_path);
goto done;
goto done;
if (patch_script_path) {
- patch_script_file = fopen(patch_script_path, "r");
+ patch_script_file = fopen(patch_script_path, "re");
if (patch_script_file == NULL) {
error = got_error_from_errno2("fopen",
patch_script_path);
*logmsg = NULL;
memset(&sb, 0, sizeof(sb));
- f = fopen(path, "r");
+ f = fopen(path, "re");
if (f == NULL)
return got_error_from_errno2("fopen", path);
goto done;
}
- f = fopen(path, "r");
+ f = fopen(path, "re");
if (f == NULL) {
err = got_error_from_errno("fopen");
goto done;
if (err)
return err;
- f = fopen(path, "w");
+ f = fopen(path, "we");
if (f == NULL) {
err = got_error_from_errno2("fopen", path);
goto done;
const struct got_error *err = NULL;
FILE *f = NULL;
- f = fopen(path, "r");
+ f = fopen(path, "re");
if (f == NULL) {
err = got_error_from_errno2("fopen", path);
goto done;
goto done;
if (patch_script_path) {
- patch_script_file = fopen(patch_script_path, "r");
+ patch_script_file = fopen(patch_script_path, "re");
if (patch_script_file == NULL) {
error = got_error_from_errno2("fopen",
patch_script_path);
goto done;
if (patch_script_path) {
- patch_script_file = fopen(patch_script_path, "r");
+ patch_script_file = fopen(patch_script_path, "re");
if (patch_script_file == NULL) {
error = got_error_from_errno2("fopen",
patch_script_path);
blob - eeaf4cbd73e78bea7a719194a8223f1826901821
blob + 6363042469cbd22c9740556448d1cc20c5eafdab
--- gotweb/gotweb.c
+++ gotweb/gotweb.c
if (asprintf(&d_file, "%s/description", dir) == -1)
return got_error_from_errno("asprintf");
- f = fopen(d_file, "r");
+ f = fopen(d_file, "re");
if (f == NULL) {
if (errno == ENOENT || errno == EACCES)
return NULL;
if (asprintf(&d_file, "%s/cloneurl", dir) == -1)
return got_error_from_errno("asprintf");
- f = fopen(d_file, "r");
+ f = fopen(d_file, "re");
if (f == NULL) {
if (errno != ENOENT && errno != EACCES)
error = got_error_from_errno2("fopen", d_file);
blob - 1d91c1f05c748a155769cbfd96cb8871ffd0c8cc
blob + dac1eae40679c47137747bc4f1d9aa0f054e8f59
--- gotweb/parse.y
+++ gotweb/parse.y
free(nfile);
return got_error_from_errno2(__func__, "strdup");
}
- if (((*nfile)->stream = fopen((*nfile)->name, "r")) == NULL) {
+ if (((*nfile)->stream = fopen((*nfile)->name, "re")) == NULL) {
char *msg = NULL;
if (asprintf(&msg, "%s", (*nfile)->name) == -1)
return got_error_from_errno("asprintf");
blob - 95fdb0726bce1615a82c90e53763702fa49bc139
blob + ec933af31517a8e95d2772b7199c7efcb9064c82
--- lib/diff3.c
+++ lib/diff3.c
*d = NULL;
- f1 = fopen(path1, "r");
+ f1 = fopen(path1, "re");
if (f1 == NULL) {
err = got_error_from_errno2("fopen", path1);
goto done;
}
- f2 = fopen(path2, "r");
+ f2 = fopen(path2, "re");
if (f1 == NULL) {
err = got_error_from_errno2("fopen", path2);
goto done;
if (err)
return err;
- if ((d3s->fp[0] = fopen(path1, "r")) == NULL)
- return got_error_from_errno2("fopen", path1);
- if ((d3s->fp[1] = fopen(path2, "r")) == NULL)
+ if ((d3s->fp[0] = fopen(path1, "re")) == NULL)
+ return got_error_from_errno2("fopen", path1);
+ if ((d3s->fp[1] = fopen(path2, "re")) == NULL)
return got_error_from_errno2("fopen", path2);
- if ((d3s->fp[2] = fopen(path3, "r")) == NULL)
+ if ((d3s->fp[2] = fopen(path3, "re")) == NULL)
return got_error_from_errno2("fopen", path3);
return merge(m, n, d3s);
*n = 0;
- f = fopen(name, "r");
+ f = fopen(name, "re");
if (f == NULL)
return got_error_from_errno2("fopen", name);
err = getchange(&p, f, d3s);
blob - eff4b9a3e9d57466366fd04d73b1eeb8d92bd371
blob + b7336cfa9779d26b5bc510b4bb45c1f5f64df5c1
--- lib/reference.c
+++ lib/reference.c
}
}
- f = fopen(abspath, "rb");
+ f = fopen(abspath, "rbe");
if (f == NULL) {
if (errno != ENOTDIR && errno != ENOENT)
err = got_error_from_errno2("fopen", abspath);
if (err)
goto done;
}
- f = fopen(packed_refs_path, "rb");
+ f = fopen(packed_refs_path, "rbe");
free(packed_refs_path);
if (f != NULL) {
struct stat sb;
goto done;
}
- f = fopen(packed_refs_path, "r");
+ f = fopen(packed_refs_path, "re");
free(packed_refs_path);
if (f) {
size_t linesize = 0;
goto done;
}
- f = fopen(packed_refs_path, "r");
+ f = fopen(packed_refs_path, "re");
if (f == NULL) {
err = got_error_from_errno2("fopen", packed_refs_path);
goto done;
blob - 08a1d596cc47c30cfb0e5dd2c6118178530bdd72
blob + 5cb71cf2d175571202994bb618fbe611d6b96a53
--- lib/worktree.c
+++ lib/worktree.c
if (err)
goto done;
- index = fopen(*fileindex_path, "rb");
+ index = fopen(*fileindex_path, "rbe");
if (index == NULL) {
if (errno != ENOENT)
err = got_error_from_errno2("fopen", *fileindex_path);
}
}
} else {
- ignoresfile = fopen(ignorespath, "r");
+ ignoresfile = fopen(ignorespath, "re");
if (ignoresfile == NULL) {
if (errno != ENOENT && errno != EACCES)
err = got_error_from_errno2("fopen",
goto done;
}
- f = fopen(path_unstaged_content, "r");
+ f = fopen(path_unstaged_content, "re");
if (f == NULL) {
err = got_error_from_errno2("fopen",
path_unstaged_content);