File: 0007-Remove-the-only-user-of-subfdoutsmall-with-stdio.patch

package info (click to toggle)
safecat 1.13%2Bgit20170317.185e8bf-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 776 kB
  • sloc: ansic: 2,748; makefile: 4
file content (72 lines) | stat: -rw-r--r-- 1,746 bytes parent folder | download
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
From: =?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz>
Date: Fri, 22 Aug 2025 00:35:32 +0200
Subject: Remove the only user of subfdoutsmall with stdio

---
 meson.build | 1 -
 safecat.c   | 5 ++---
 subfd.h     | 1 -
 subfdouts.c | 7 -------
 4 files changed, 2 insertions(+), 12 deletions(-)
 delete mode 100644 subfdouts.c

diff --git a/meson.build b/meson.build
index 19be80a..4275f25 100644
--- a/meson.build
+++ b/meson.build
@@ -15,7 +15,6 @@ executable('safecat',
 	'strerr_die.c',
 	'strerr_sys.c',
 	'subfderr.c',
-	'subfdouts.c',
 	'substdi.c',
 	'substdio.c',
 	'substdo.c',
diff --git a/safecat.c b/safecat.c
index cb3c8f4..0a86cf3 100644
--- a/safecat.c
+++ b/safecat.c
@@ -21,6 +21,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <signal.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 
@@ -118,9 +119,7 @@ int main(int argc, char *argv[]) {
   unlink(tmppath.s);
 
   /* Print the name of the file we've created, as a curtesy. */
-  substdio_puts(subfdoutsmall,outfile.s);
-  substdio_puts(subfdoutsmall,"\n");
-  substdio_flush(subfdoutsmall);
+  puts(outfile.s);
   exit(0);
 }
 /* ****************************************************************** */
diff --git a/subfd.h b/subfd.h
index a560889..e36b8a6 100644
--- a/subfd.h
+++ b/subfd.h
@@ -3,7 +3,6 @@
 
 #include "substdio.h"
 
-extern substdio *subfdoutsmall;
 extern substdio *subfderr;
 
 #endif
diff --git a/subfdouts.c b/subfdouts.c
deleted file mode 100644
index 471bba8..0000000
--- a/subfdouts.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "readwrite.h"
-#include "substdio.h"
-#include "subfd.h"
-
-char subfd_outbufsmall[256];
-static substdio it = SUBSTDIO_FDBUF(false_write,1,subfd_outbufsmall,256);
-substdio *subfdoutsmall = &it;