diff --git a/assembler/rxasassm.h b/assembler/rxasassm.h index f85055f1f..7a6973da2 100644 --- a/assembler/rxasassm.h +++ b/assembler/rxasassm.h @@ -4,7 +4,7 @@ #ifndef CREXX_RXASASSM_H #define CREXX_RXASASSM_H -#define rxversion "crexx-f0052" +#define rxversion "crexx-HF001" #include "rxas.h" #include "rxasgrmr.h" diff --git a/compiler/rxcpmain.h b/compiler/rxcpmain.h index 78aed3b9f..da8221191 100644 --- a/compiler/rxcpmain.h +++ b/compiler/rxcpmain.h @@ -4,7 +4,7 @@ #ifndef CREXX_RXCPMAIN_H #define CREXX_RXCPMAIN_H -#define rxversion "crexx-f0052" +#define rxversion "crexx-HF001" #include #include "platform.h" diff --git a/cpacker/rxcpack.c b/cpacker/rxcpack.c index 95117346c..bae9d013e 100644 --- a/cpacker/rxcpack.c +++ b/cpacker/rxcpack.c @@ -12,7 +12,7 @@ #include #include -#define rxversion "crexx-f0052" +#define rxversion "crexx-HF001" #define NAME_BUFFER_SIZE 256 #define GLOBAL_SYMBOL "rx__pg" diff --git a/disassembler/rxdadism.h b/disassembler/rxdadism.h index c2ef19c96..2bf7253d5 100644 --- a/disassembler/rxdadism.h +++ b/disassembler/rxdadism.h @@ -4,7 +4,7 @@ #include "rxas.h" #include "rxbin.h" -#define rxversion "crexx-f0052" +#define rxversion "crexx-HF001" /* Disassembler */ void disassemble(bin_space *pgm, module_file *module, FILE *stream, int print_all_constant_pool); diff --git a/docs/index.md b/docs/index.md index f71066a65..0e5b2b5e9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ # CREXX -_Release Documentation - crexx-f0052 - Sept 2022_ +_Release Documentation - crexx-HF001 - Sept 2022_ ## REXX Language Implementation Architecture @@ -40,7 +40,7 @@ The documentation is stored in the code repository/branch under the [/doc](https # Current Component User Documentation -crexx-f0052 +crexx-HF001 ## Running a REXX program diff --git a/history.txt b/history.txt index 3f6b43e5b..c91d646df 100644 --- a/history.txt +++ b/history.txt @@ -1,5 +1,7 @@ CREXX History / Change Log - +HF001 - Hotfix for Windows + Fixed Windows DLL Load in current directory + Fixed Removal of "\r" in spawned (ADDRESS) Windows Command io Redirect F0052 - Fixes and enhancements RXPA - Added an "exit" to trap say instruction output Compiler - Fix Register swap back after a function call with global register diff --git a/interpreter/rxspawn.c b/interpreter/rxspawn.c index ed3dbe151..44626e983 100644 --- a/interpreter/rxspawn.c +++ b/interpreter/rxspawn.c @@ -524,11 +524,18 @@ THREAD_RETURN Output2ArrayThread(void* lpvThreadParam) { if (!buffer) buffer = add_new_element(context->reg); #ifdef _WIN32 /* Remove the \r if it is there */ - if (i > 0 && lpBuffer[i - 1] == '\r') - if (i - start - 1) string_append_chars(buffer, lpBuffer + start, i - start - 1); + if (i > 0 && lpBuffer[i - 1] == '\r') { + if (i - start - 1) + string_append_chars(buffer, lpBuffer + start, + i - start - 1); + } else #endif - if (i - start) string_append_chars(buffer, lpBuffer + start, i - start); + { + if (i - start) + string_append_chars(buffer, lpBuffer + start, + i - start); + } buffer = 0; start = i + 1; } diff --git a/interpreter/rxvmintp.c b/interpreter/rxvmintp.c index 2bc00605f..bf409ef64 100644 --- a/interpreter/rxvmintp.c +++ b/interpreter/rxvmintp.c @@ -3809,6 +3809,7 @@ START_INSTRUCTION(OPENDLL_REG_REG_REG) CALC_DISPATCH(3) DEBUG("TRACE - SPAWN R%lu,R%lu,R%lu\n", REG_IDX(1), REG_IDX(2), REG_IDX(3)); { int command_rc = 0; + int spawn_rc = 0; REDIRECT *pIn = 0; REDIRECT *pOut = 0; REDIRECT *pErr = 0; @@ -3823,7 +3824,13 @@ START_INSTRUCTION(OPENDLL_REG_REG_REG) CALC_DISPATCH(3) if (op3R->num_attributes > 2) pErr = (REDIRECT*)(op3R->attributes[2])->binary_value; /* op3R->attributes[2] is the environment variables */ - if (shellspawn(command, pIn, pOut, pErr, op3R->attributes[3], &command_rc, &errorText)) { + spawn_rc = shellspawn(command, pIn, pOut, pErr, op3R->attributes[3], &command_rc, &errorText); + if (spawn_rc == SHELLSPAWN_NOFOUND) { + signal_details = "Command Not Found"; + free(command); + goto FAILURE; + } + if (spawn_rc) { signal_details = errorText; free(command); goto FAILURE; diff --git a/interpreter/rxvmintp.h b/interpreter/rxvmintp.h index 23d21a474..3b7051906 100644 --- a/interpreter/rxvmintp.h +++ b/interpreter/rxvmintp.h @@ -5,7 +5,7 @@ #include "rxbin.h" #include "rxpa.h" -#define rxversion "crexx-f0052" +#define rxversion "crexx-HF001" #define SMALLEST_STRING_BUFFER_LENGTH 32 diff --git a/interpreter/rxvmload.c b/interpreter/rxvmload.c index 1c0e85378..f22d2b3be 100644 --- a/interpreter/rxvmload.c +++ b/interpreter/rxvmload.c @@ -350,7 +350,7 @@ int rxldmod(rxvm_context *context, char *file_name) { n = prep_and_link_module(context, current_rxpa_context->plugin_being_loaded); current_rxpa_context->plugin_being_loaded = 0; // We are done with it! It will be freed eventually } else { - DEBUG("Failed to load plugin %s\n", file_name); + DEBUG("Failed to load plugin %s (rc=%d)\n", file_name, rc); free_rxpa_context(current_rxpa_context); return(-1); } diff --git a/rxpa/crexxpa.h b/rxpa/crexxpa.h index d12bd0fb7..bf6789252 100755 --- a/rxpa/crexxpa.h +++ b/rxpa/crexxpa.h @@ -4,7 +4,7 @@ #ifndef CREXX_PA_H_ #define CREXX_PA_H_ -#define rxpa_version "crexx-f0052" +#define rxpa_version "crexx-HF001" // Plugin Support Functions and Macros diff --git a/rxpa/rxpa.c b/rxpa/rxpa.c index defaf2400..30f293c2f 100644 --- a/rxpa/rxpa.c +++ b/rxpa/rxpa.c @@ -33,10 +33,22 @@ int load_plugin(rxpa_initctxptr ctx, char* dir, char* file_name) // Create a full file name buffer and append the directory and file name char* full_file_name = malloc(strlen(dir) + strlen(file_name) + 2); sprintf(full_file_name, "%s\\%s", dir, file_name); - // Load the DLL + SetDllDirectory("."); HMODULE hDll = LoadLibrary(TEXT(full_file_name)); if (!hDll) { + DWORD errorCode = GetLastError(); + LPVOID errorMsg; + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + errorCode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR)&errorMsg, + 0, + NULL + ); + LocalFree(errorMsg); return -1; }