|
From: <kin...@us...> - 2024-09-19 20:03:21
|
Revision: 7238
http://sourceforge.net/p/teem/code/7238
Author: kindlmann
Date: 2024-09-19 20:03:20 +0000 (Thu, 19 Sep 2024)
Log Message:
-----------
added ability to recognize -= as the same stdin/stdout that - is recognized as
Modified Paths:
--------------
teem/trunk/src/air/miscAir.c
Modified: teem/trunk/src/air/miscAir.c
===================================================================
--- teem/trunk/src/air/miscAir.c 2024-09-06 08:11:53 UTC (rev 7237)
+++ teem/trunk/src/air/miscAir.c 2024-09-19 20:03:20 UTC (rev 7238)
@@ -104,10 +104,14 @@
/*
******** airFopen()
**
-** encapsulates that idea that "-" is either standard in or stardard
-** out, and does McRosopht stuff required to make piping work
+** encapsulates that idea that "-" OR "-=" is either standard in or standard
+** out, and does McRosopht stuff required to make piping work. Handling "-="
+** is a convenience for implementing NrrdIoState->declineStdioOnTTY, with
+** the semantics (not handled here) that "-=" means "read/write from stdin/
+** stdout, even when it IS a terminal". But this is currently only supported
+** in full Teem, not the minimal NrrdIO library.
**
-** Does not error checking. If fopen fails, then C' errno and strerror are
+** Does no error checking. If fopen fails, then C' errno and strerror are
** left untouched for the caller to access.
*/
FILE *
@@ -114,7 +118,11 @@
airFopen(const char *name, FILE *std, const char *mode) {
FILE *ret;
- if (!strcmp(name, "-")) {
+ if (!strcmp(name, "-")
+ /* ---- BEGIN non-NrrdIO */
+ || !strcmp(name, "-=")
+ /* ---- END non-NrrdIO */
+ ) {
ret = std;
#ifdef _WIN32
if (strchr(mode, 'b')) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|