[fenix] 30/127: Added patches for handling stdin/stdout
Peter Pentchev
roam at ringlet.net
Thu Dec 17 14:39:32 UTC 2015
This is an automated email from the git hooks/post-receive script.
roam-guest pushed a commit to branch master
in repository fenix.
commit de12d44eed9f7d6ff2b85bf268f3e2519b7d3db7
Author: Miriam Ruiz <miriam at debian.org>
Date: Sun Jul 29 18:15:22 2007 +0000
Added patches for handling stdin/stdout
---
debian/changelog | 1 +
debian/patches/common_stdfiles.patch | 35 +++++++++++++++++++++++++++++++++++
debian/patches/fxc_output.patch | 35 -----------------------------------
debian/patches/fxi_input.patch | 24 ++++++++++++++++++++++++
debian/patches/series | 2 ++
5 files changed, 62 insertions(+), 35 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 222eca3..6ef25b9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ fenix (0.92a.dfsg1-1) UNRELEASED; urgency=low
* Renamed package to simply fenix
* Added patch to synchronize code against the latest CVS version
+ * Added support for reading programs from stdin in the interpreter.
-- Miriam Ruiz <little_miry at yahoo.es> Fri, 13 Jul 2007 21:30:27 +0000
diff --git a/debian/patches/common_stdfiles.patch b/debian/patches/common_stdfiles.patch
new file mode 100644
index 0000000..474a3d9
--- /dev/null
+++ b/debian/patches/common_stdfiles.patch
@@ -0,0 +1,35 @@
+diff -ruN Fenix/common/files.c fenix-0.92a.dfsg1/common/files.c
+--- Fenix/common/files.c 2007-04-12 22:07:56.000000000 +0000
++++ fenix-0.92a.dfsg1/common/files.c 2007-07-29 17:55:07.531111567 +0000
+@@ -460,6 +460,31 @@
+ memset (f, 0, sizeof(file)) ;
+ strncpy (f->name, filename, MAX_PATH);
+
++ if (strcmp(filename, "-") == 0 && strchr(mode,'r'))
++ {
++ char buffer[1024];
++ size_t buflen;
++ f->type = F_FILE;
++ f->fp = tmpfile();
++ opened_files++;
++
++ while ((buflen = fread(buffer, 1, sizeof(buffer), stdin)))
++ {
++ fwrite(buffer, 1, buflen, f->fp);
++ }
++ fseek (f->fp, 0, SEEK_SET);
++
++ return f ;
++ }
++
++ if (strcmp(filename, "-") == 0 && strchr(mode,'w'))
++ {
++ f->type = F_STDFILE;
++ f->fp = stdout;
++ opened_files++;
++ return f ;
++ }
++
+ c = filename ;
+ for (n = c+strlen(c) ; n >= c ; n--)
+ {
diff --git a/debian/patches/fxc_output.patch b/debian/patches/fxc_output.patch
index 3f39abe..b2286fb 100644
--- a/debian/patches/fxc_output.patch
+++ b/debian/patches/fxc_output.patch
@@ -48,38 +48,3 @@
memset (&dcb, 0, sizeof(dcb));
---- fenix0.92-0.92a.dfsg1.orig/common/files.c
-+++ fenix0.92-0.92a.dfsg1/common/files.c
-@@ -460,6 +460,22 @@
- memset (f, 0, sizeof(file)) ;
- strncpy (f->name, filename, MAX_PATH);
-
-+ if (strcmp(filename, "-") == 0 && strchr(mode,'w'))
-+ {
-+ f->type = F_STDFILE;
-+ f->fp = stdout;
-+ opened_files++;
-+ return f ;
-+ }
-+
-+ if (strcmp(filename, "-") == 0 && strchr(mode,'r'))
-+ {
-+ f->type = F_STDFILE;
-+ f->fp = stdin;
-+ opened_files++;
-+ return f ;
-+ }
-+
- c = filename ;
- for (n = c+strlen(c) ; n >= c ; n--)
- {
---- fenix0.92-0.92a.dfsg1.orig/include/files_st.h
-+++ fenix0.92-0.92a.dfsg1/include/files_st.h
-@@ -39,6 +39,7 @@
- #define F_XFILE 1
- #define F_FILE 2
- #define F_GZFILE 3
-+#define F_STDFILE 4
-
- #include <zlib.h>
-
diff --git a/debian/patches/fxi_input.patch b/debian/patches/fxi_input.patch
new file mode 100644
index 0000000..92d04f8
--- /dev/null
+++ b/debian/patches/fxi_input.patch
@@ -0,0 +1,24 @@
+diff -ruN fenix-0.92a.raw/fxi/src/dcbr.c fenix-0.92a/fxi/src/dcbr.c
+--- fenix-0.92a.raw/fxi/src/dcbr.c 2007-07-28 11:07:02.566318000 +0000
++++ fenix-0.92a/fxi/src/dcbr.c 2007-07-29 17:40:47.485362067 +0000
+@@ -144,7 +144,7 @@
+ file * fp ;
+
+ /* check for existence of the DCB FILE */
+- if (!file_exists(filename)) return 0 ;
++ if (strcmp(filename,"-")!=0 && !file_exists(filename)) return 0 ;
+
+ fp = file_open (filename, "rb0") ;
+ if (!fp)
+diff -ruN fenix-0.92a.raw/fxi/src/main.c fenix-0.92a/fxi/src/main.c
+--- fenix-0.92a.raw/fxi/src/main.c 2007-07-28 11:06:34.620571000 +0000
++++ fenix-0.92a/fxi/src/main.c 2007-07-28 11:10:59.733140328 +0000
+@@ -248,7 +248,7 @@
+
+ for (i = 1 ; i < argc ; i++)
+ {
+- if (argv[i][0] == '-')
++ if (argv[i][0] == '-' && argv[i][1])
+ {
+ j = 1 ;
+ while (argv[i][j])
diff --git a/debian/patches/series b/debian/patches/series
index 2c9050e..093fa73 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,5 +5,7 @@ i18n_fpg.patch
i18n_map.patch
fxi_binname.patch
fxc_nosdlinit.patch
+common_stdfiles.patch
fxc_output.patch
+fxi_input.patch
0.92a_to_cvs-20070713.1513.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/fenix.git
More information about the Pkg-games-commits
mailing list