diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2019-02-25 09:15:02 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2019-02-25 09:15:02 +0200 |
commit | 44611db36ba329fab248179e0350d44fcff5e3c2 (patch) | |
tree | fc1e2676b5c0d2865257aaf65cd66b1f5f473cb5 /eval.c | |
parent | ef25d1166e7a183dd4d07f73904775234359de81 (diff) | |
download | gawk-44611db36ba329fab248179e0350d44fcff5e3c2.tar.gz |
Improvements for z/OS, building and test suite.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -1023,7 +1023,23 @@ update_ERRNO_string(const char *string) { update_PROCINFO_num("errno", 0); unref(ERRNO_node->var_value); - ERRNO_node->var_value = make_string(string, strlen(string)); + size_t len = strlen(string); +#if defined(USE_EBCDIC) && defined(ELIDE_IBM_ERROR_CODE) + // skip over leading IBM error code + // N.B. This code is untested + if (isupper(string[0]) && isupper(string[1])) { + while (*string && *string != ' ') + string++; + + while (*string && *string == ' ') + string++; + + len = strlen(string); + if (string[len-1] == '.') + len--; // remove the final '.' + } +#endif + ERRNO_node->var_value = make_string(string, len); } /* unset_ERRNO --- eliminate the value of ERRNO */ |