From 0e7507b2858aebcaefaf3aaa3139fbfc3d0307a1 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Tue, 10 May 2022 20:19:42 +0200 Subject: [PATCH] [dos] Do not define CONFIG_OS_UNIX for DOS --- configure.ac | 1 + src/osdep/dos/dos.c | 12 ++++++++++++ src/osdep/dos/sysinfo.h | 19 +++++++++++++++++++ src/osdep/system.h | 2 ++ src/protocol/uri.c | 2 +- 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/osdep/dos/sysinfo.h diff --git a/configure.ac b/configure.ac index cbfa93be..33e87b25 100644 --- a/configure.ac +++ b/configure.ac @@ -189,6 +189,7 @@ test "$CONFIG_OS_OS2" = yes && LDFLAGS=`echo "$LDFLAGS" | sed "s/-Zexe//g"` AC_MSG_CHECKING([for UNIX]) dnl FIXME: some depend kind of mechanism if test "$CONFIG_OS_BEOS" = no && \ + test "$CONFIG_OS_DOS" = no && \ test "$CONFIG_OS_RISCOS" = no && \ test "$CONFIG_OS_WIN32" = no && \ test "$CONFIG_OS_OS2" = no; then diff --git a/src/osdep/dos/dos.c b/src/osdep/dos/dos.c index 74a99271..9f65d100 100644 --- a/src/osdep/dos/dos.c +++ b/src/osdep/dos/dos.c @@ -80,6 +80,18 @@ do { \ #define overalloc() overalloc_at(__FILE__, __LINE__) +int +is_xterm(void) +{ + return 0; +} + +int +get_system_env(void) +{ + return (0); +} + int set_nonblocking_fd(int fd) { diff --git a/src/osdep/dos/sysinfo.h b/src/osdep/dos/sysinfo.h new file mode 100644 index 00000000..ad294676 --- /dev/null +++ b/src/osdep/dos/sysinfo.h @@ -0,0 +1,19 @@ + +#ifndef EL__OSDEP_DOS_SYSINFO_H +#define EL__OSDEP_DOS_SYSINFO_H + +#ifdef CONFIG_OS_DOS + +#define SYSTEM_NAME "DOS" +#define SYSTEM_STR "DOS" +#define DEFAULT_SHELL "command.com" +#define GETSHELL getenv("COMSPEC") + +#define dir_sep(x) ((x) == '/' || (x) == '\\') +#define NO_ASYNC_LOOKUP +/* #define NO_FG_EXEC */ +#define DOS_FS +#define NO_FORK_ON_EXIT + +#endif +#endif diff --git a/src/osdep/system.h b/src/osdep/system.h index d616ba6b..cb62bbe9 100644 --- a/src/osdep/system.h +++ b/src/osdep/system.h @@ -2,6 +2,7 @@ #define EL__OSDEP_SYSTEM_H #if !defined(CONFIG_OS_BEOS) \ + && !defined(CONFIG_OS_DOS) \ && !defined(CONFIG_OS_OS2) \ && !defined(CONFIG_OS_RISCOS) \ && !defined(CONFIG_OS_UNIX) \ @@ -15,6 +16,7 @@ #include "osdep/win32/overrides.h" #include "osdep/beos/sysinfo.h" +#include "osdep/dos/sysinfo.h" #include "osdep/os2/sysinfo.h" #include "osdep/riscos/sysinfo.h" #include "osdep/unix/sysinfo.h" diff --git a/src/protocol/uri.c b/src/protocol/uri.c index 54e0a241..2f16356f 100644 --- a/src/protocol/uri.c +++ b/src/protocol/uri.c @@ -602,7 +602,7 @@ add_uri_to_string(struct string *string, const struct uri *uri, "URI_FILENAME should be used alone %d", components); if (wants(URI_PATH) && !is_uri_dir_sep(uri, *filename)) { -#ifdef CONFIG_OS_WIN32 +#if defined(CONFIG_OS_WIN32) || defined(CONFIG_OS_DOS) if (uri->protocol != PROTOCOL_FILE) #endif /* FIXME: Add correct separator */