From: Andy Polyakov Date: Wed, 21 Mar 2018 10:16:50 +0000 (+0100) Subject: o_fopen.c: compensate for e_os.h omission. X-Git-Tag: OpenSSL_1_1_1-pre4~76 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=96f1b64d8cdca10694f84fb3aabfdd35f0604555 o_fopen.c: compensate for e_os.h omission. At earlier point e_os.h was omitted from a number of headers (in order to emphasize OS neutrality), but this affected o_fopen.c, which is not OS-neutral, and contains some DJGPP-specific code. Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/5708) --- diff --git a/crypto/o_fopen.c b/crypto/o_fopen.c index 951d034dda..1b4028c9a8 100644 --- a/crypto/o_fopen.c +++ b/crypto/o_fopen.c @@ -15,6 +15,9 @@ # ifdef _WIN32 # include # endif +# ifdef __DJGPP__ +# include +# endif FILE *openssl_fopen(const char *filename, const char *mode) { @@ -64,7 +67,7 @@ FILE *openssl_fopen(const char *filename, const char *mode) { char *newname = NULL; - if (!HAS_LFN_SUPPORT(filename)) { + if (pathconf(filename, _PC_NAME_MAX) <= 12) { /* 8.3 file system? */ char *iterator; char lastchar;