]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
os400: workaround an IBM ASCII run-time library bug
authorPatrick Monnerat <patrick@monnerat.net>
Fri, 26 Jul 2024 15:15:27 +0000 (17:15 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 26 Jul 2024 22:17:13 +0000 (00:17 +0200)
IBM-provided ASCII function puts() does not output an expected trailing
newline: emulate the correct behavior using other functions.

Closes #14281

lib/setup-os400.h
packages/OS400/README.OS400

index 9dd546e9b1799d3d8208d0becfb73683edf3ca23..ef7baca67efff4022e5de3ceabff04d37e3dfba2 100644 (file)
@@ -38,6 +38,15 @@ typedef unsigned long   u_int32_t;
 #define isatty(fd)      0
 
 
+/* Workaround bug in IBM QADRT runtime library:
+ * function puts() does not output the implicit trailing newline.
+ */
+
+#include <stdio.h>      /* Be sure it is loaded. */
+#undef puts
+#define puts(s) (fputs((s), stdout) == EOF? EOF: putchar('\n'))
+
+
 /* System API wrapper prototypes & definitions to support ASCII parameters. */
 
 #include <sys/socket.h>
index 38b2c7f06c45101b362856272eac2b55d7ec6872..1bc4132f679797b4e6a2e27f501769934a61e00a 100644 (file)
@@ -226,8 +226,7 @@ in fact, very few common utilities are available. As a consequence, the
 config-os400.h has been coded manually and the compilation scripts are
 a set of shell scripts stored in subdirectory packages/OS400.
 
-  The "curl" command and the test environment are currently not supported on
-OS/400.
+  The test environment is currently not supported on OS/400.
 
 
 Protocols currently implemented on OS/400: