diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 000000000..94f55bd58 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,35 @@ +version: 0.4.9-{build} +environment: + matrix: + - TOOLSET: vs2017 + +os: Visual Studio 2017 +matrix: + fast_finish: true + +install: + # Download Premake + - ps: Start-FileDownload 'https://github.com/premake/premake-core/releases/download/v5.0.0-alpha11/premake-5.0.0-alpha11-windows.zip' 'premake.zip' + + # Extract it in-place; premake5.exe is at the top level. + - 7z x premake.zip + + ## Add NSIS to PATH + - cmd: set PATH=%PATH%;C:\Program Files (x86)\NSIS\; + + # Generate solution files using premake. + - premake5.exe %TOOLSET% + +configuration: + - Release + +build_script: + - premake5.exe clink_release + +artifacts: + - path: .build/release/**/clink_DEV.zip + name: clink_DEV + - path: .build/release/**/clink_DEV_pdb.zip + name: clink_DEV_pdb + - path: .build/release/**/clink_DEV_setup.exe + name: clink_DEV_setup diff --git a/README.md b/README.md index acd57453e..931e3dcd8 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Clink can be extended through its Lua API which allows easy creation context sen ### Building Clink -Clink's uses [Premake](http://premake.github.io) to generate Visual Studio solutions or makefiles for MinGW. Note that Premake >= 5.0-alpha8 is required. +Clink's uses [Premake](http://premake.github.io) to generate Visual Studio solutions or makefiles for MinGW. Note that Premake >= 5.0-alpha11 is required. 1. Cd to your clone of Clink. 2. Run "premake <toolchain>" (where "<toolchain>" is one of Premake's actions - see "premake --help") diff --git a/clink/dll/doskey.c b/clink/dll/doskey.c index f69ed264b..e0ba63c6f 100644 --- a/clink/dll/doskey.c +++ b/clink/dll/doskey.c @@ -73,7 +73,7 @@ int continue_doskey(wchar_t* chars, unsigned max_chars) { wchar_t* read = g_state.alias_next; - if (g_state.alias_text == NULL) + if (g_state.alias_text == NULL || read == NULL) return 0; if (*read == '\0') diff --git a/clink/dll/rl.c b/clink/dll/rl.c index fd8b6e832..114bd210d 100644 --- a/clink/dll/rl.c +++ b/clink/dll/rl.c @@ -508,8 +508,10 @@ static char* call_readline_impl(const char* prompt) // Make sure that EOL wrap is on. Readline's told the terminal supports it. { int stdout_flags = ENABLE_PROCESSED_OUTPUT|ENABLE_WRAP_AT_EOL_OUTPUT; + int oldstdout_flags = 0; HANDLE handle_stdout = GetStdHandle(STD_OUTPUT_HANDLE); - SetConsoleMode(handle_stdout, stdout_flags); + GetConsoleMode(handle_stdout, &oldstdout_flags); + SetConsoleMode(handle_stdout, stdout_flags|oldstdout_flags); } // Initialisation diff --git a/installer/premake5.lua b/installer/premake5.lua index 9f8b043f8..693f86b6f 100644 --- a/installer/premake5.lua +++ b/installer/premake5.lua @@ -138,7 +138,7 @@ newaction { local x64_ok = true; local toolchain = "ERROR" if have_msbuild then - toolchain = _OPTIONS["clink_vs_ver"] or "vs2013" + toolchain = _OPTIONS["clink_vs_ver"] or "vs2017" exec(premake .. " --clink_ver=" .. clink_ver .. " " .. toolchain) ret = exec("msbuild /m /v:q /p:configuration=release /p:platform=win32 .build/" .. toolchain .. "/clink.sln") diff --git a/premake5.lua b/premake5.lua index a31815224..ab85ec559 100644 --- a/premake5.lua +++ b/premake5.lua @@ -39,7 +39,7 @@ function get_last_git_commit() return line:sub(1, 6) end - return "?" + return "unknown" end -------------------------------------------------------------------------------- @@ -102,7 +102,7 @@ solution("clink") location(to) characterset("MBCS") - flags("Symbols") + symbols "on" flags("StaticRuntime") defines("HAVE_CONFIG_H") defines("HANDLE_MULTIBYTE") diff --git a/readline/readline/bind.c b/readline/readline/bind.c index 4c898a699..b53ff3c08 100644 --- a/readline/readline/bind.c +++ b/readline/readline/bind.c @@ -776,7 +776,7 @@ _rl_read_file (filename, sizep) char *buffer; int i, file; - if ((stat (filename, &finfo) < 0) || (file = open (filename, O_RDONLY, 0666)) < 0) + if (((file = open (filename, O_RDONLY, 0666)) < 0) || (fstat (file, &finfo) < 0)) return ((char *)NULL); file_size = (size_t)finfo.st_size;