summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2014-08-12 14:16:09 -0400
committerQuentin Carbonneaux2014-08-12 14:16:09 -0400
commit797fdfae2871064aef5fcb0782ed109d963dca3e (patch)
treedb2f013579bdd442cf1c2668fa4fc8012f75805f
parent262a71f2d871419b68c1477ae222ffe37e051216 (diff)
trivial bug in ex_get
-rw-r--r--exec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/exec.c b/exec.c
index 49991f1..05fe40e 100644
--- a/exec.c
+++ b/exec.c
@@ -95,17 +95,17 @@ ex_get(EBuf *eb, char *file)
struct stat st;
char *file1;
- if (eb->path && strcmp(eb->path, file) != 0)
- if (eb->frev != eb_revision(eb)) {
- errstr = "file not written";
- return 1;
- }
if (!file)
file = eb->path;
if (!file) {
errstr = "no file to read from";
return 1;
}
+ if (eb->path && strcmp(eb->path, file) != 0)
+ if (eb->frev != eb_revision(eb)) {
+ errstr = "file not written";
+ return 1;
+ }
fd = open(file, O_RDONLY);
if (fd == -1) {
errstr = "cannot open file";