aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-07-11 21:41:58 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-07-11 21:41:58 +0200
commitbb6cfc65c9e86d85c74d5bcce6c32a8937e611f8 (patch)
tree332af1762d9410f47292b9ae048522dba45d5c0f
parenta657e8499ab04bf8b9b4ffcb954acee574d239a1 (diff)
downloadvis-bb6cfc65c9e86d85c74d5bcce6c32a8937e611f8.tar.gz
vis-bb6cfc65c9e86d85c74d5bcce6c32a8937e611f8.tar.xz
vis: rename struct member to avoid conflict with standard library
Closes #60
-rw-r--r--editor.h2
-rw-r--r--vis.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/editor.h b/editor.h
index edfa210..a2ab3f5 100644
--- a/editor.h
+++ b/editor.h
@@ -189,7 +189,7 @@ enum Mark {
struct File {
Text *text;
const char *name;
- bool stdin;
+ bool is_stdin;
struct stat stat;
int refcount;
Mark marks[MARK_LAST];
diff --git a/vis.c b/vis.c
index 275d48e..8e51bce 100644
--- a/vis.c
+++ b/vis.c
@@ -1709,7 +1709,7 @@ static bool cmd_write(Filerange *range, enum CmdOpt opt, const char *argv[]) {
if (!argv[1])
argv[1] = file->name;
if (!argv[1]) {
- if (file->stdin) {
+ if (file->is_stdin) {
if (strchr(argv[0], 'q')) {
ssize_t written = text_range_write(text, range, STDOUT_FILENO);
if (written == -1 || (size_t)written != text_range_size(range)) {
@@ -2410,7 +2410,7 @@ int main(int argc, char *argv[]) {
char buf[PIPE_BUF];
File *file = vis->win->file;
Text *txt = file->text;
- file->stdin = true;
+ file->is_stdin = true;
while ((len = read(STDIN_FILENO, buf, sizeof buf)) > 0)
text_insert(txt, text_size(txt), buf, len);
if (len == -1)