Skip to content

Commit

Permalink
HF001
Browse files Browse the repository at this point in the history
  • Loading branch information
adesutherland committed Sep 12, 2024
1 parent 8b7c664 commit 1948e2a
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 15 deletions.
2 changes: 1 addition & 1 deletion assembler/rxasassm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion compiler/rxcpmain.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef CREXX_RXCPMAIN_H
#define CREXX_RXCPMAIN_H

#define rxversion "crexx-f0052"
#define rxversion "crexx-HF001"

#include <stdio.h>
#include "platform.h"
Expand Down
2 changes: 1 addition & 1 deletion cpacker/rxcpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <string.h>
#include <ctype.h>

#define rxversion "crexx-f0052"
#define rxversion "crexx-HF001"

#define NAME_BUFFER_SIZE 256
#define GLOBAL_SYMBOL "rx__pg"
Expand Down
2 changes: 1 addition & 1 deletion disassembler/rxdadism.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CREXX

_Release Documentation - crexx-f0052 - Sept 2022_
_Release Documentation - crexx-HF001 - Sept 2022_

## REXX Language Implementation Architecture

Expand Down Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion history.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 10 additions & 3 deletions interpreter/rxspawn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
9 changes: 8 additions & 1 deletion interpreter/rxvmintp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion interpreter/rxvmintp.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "rxbin.h"
#include "rxpa.h"

#define rxversion "crexx-f0052"
#define rxversion "crexx-HF001"

#define SMALLEST_STRING_BUFFER_LENGTH 32

Expand Down
2 changes: 1 addition & 1 deletion interpreter/rxvmload.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion rxpa/crexxpa.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 13 additions & 1 deletion rxpa/rxpa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 1948e2a

Please sign in to comment.