File: upstream-57f2de093a.diff

package info (click to toggle)
tmux 1.9-6
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,912 kB
  • ctags: 3,263
  • sloc: ansic: 32,468; sh: 4,311; awk: 339; makefile: 248
file content (25 lines) | stat: -rw-r--r-- 686 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From 57f2de093a1ceabd5718a0ccfec487e21141a16f Mon Sep 17 00:00:00 2001
From: nicm <nicm>
Date: Mon, 7 Apr 2014 10:32:16 +0000
Subject: [PATCH 3/6] save-buffer needs to use O_TRUNC.

---
 cmd-save-buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd-save-buffer.c b/cmd-save-buffer.c
index 3788fc2..9730982 100644
--- a/cmd-save-buffer.c
+++ b/cmd-save-buffer.c
@@ -111,7 +111,7 @@ cmd_save_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
 		if (fd != -1)
 			f = fdopen(fd, "ab");
 	} else {
-		fd = openat(cwd, path, O_CREAT|O_RDWR, 0600);
+		fd = openat(cwd, path, O_CREAT|O_RDWR|O_TRUNC, 0600);
 		if (fd != -1)
 			f = fdopen(fd, "wb");
 	}
-- 
1.9.2