summaryrefslogtreecommitdiff
path: root/nuttx/lib/stdio/lib_fgets.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/lib/stdio/lib_fgets.c')
-rw-r--r--nuttx/lib/stdio/lib_fgets.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/nuttx/lib/stdio/lib_fgets.c b/nuttx/lib/stdio/lib_fgets.c
index e84e031f9..a4f9089ed 100644
--- a/nuttx/lib/stdio/lib_fgets.c
+++ b/nuttx/lib/stdio/lib_fgets.c
@@ -50,13 +50,32 @@
* Definitions
****************************************************************************/
/* Some environments may return CR as end-of-line, others LF, and others
- * both. The logic here assumes either but not both.
+ * both. If not specified, the logic here assumes either (but not both) as
+ * the default.
*/
-#undef CONFIG_EOL_IS_CR
-#undef CONFIG_EOL_IS_LF
-#undef CONFIG_EOL_IS_BOTH_CRLF
-#define CONFIG_EOL_IS_EITHER_CRLF 1
+#if defined(CONFIG_EOL_IS_CR)
+# undef CONFIG_EOL_IS_LF
+# undef CONFIG_EOL_IS_BOTH_CRLF
+# undef CONFIG_EOL_IS_EITHER_CRLF
+#elif defined(CONFIG_EOL_IS_LF)
+# undef CONFIG_EOL_IS_CR
+# undef CONFIG_EOL_IS_BOTH_CRLF
+# undef CONFIG_EOL_IS_EITHER_CRLF
+#elif defined(CONFIG_EOL_IS_BOTH_CRLF)
+# undef CONFIG_EOL_IS_CR
+# undef CONFIG_EOL_IS_LF
+# undef CONFIG_EOL_IS_EITHER_CRLF
+#elif defined(CONFIG_EOL_IS_EITHER_CRLF)
+# undef CONFIG_EOL_IS_CR
+# undef CONFIG_EOL_IS_LF
+# undef CONFIG_EOL_IS_BOTH_CRLF
+#else
+# undef CONFIG_EOL_IS_CR
+# undef CONFIG_EOL_IS_LF
+# undef CONFIG_EOL_IS_BOTH_CRLF
+# define CONFIG_EOL_IS_EITHER_CRLF 1
+#endif
/****************************************************************************
* Private Type Declarations