Browse Source

ChipMater minor fix pack:

* Error if color codes to 0< or >15.
 * Make HELP & EDIT available in all VERSIONs.
 * All files are closed when variables are cleared: NEW & RUN
tags/v3.20f
Jon Foster 2 years ago
parent
commit
9ca2d013aa
5 changed files with 23 additions and 10 deletions
  1. +11
    -7
      bwb_inp.c
  2. +7
    -0
      bwb_var.c
  3. +2
    -0
      bwbasic.h
  4. +2
    -2
      bwd_cmd.c
  5. +1
    -1
      bwx_tty.c

+ 11
- 7
bwb_inp.c View File

@@ -162,6 +162,16 @@ CleanTextInput (char *buffer)
}
}

void bwb_close_all() {
FileType *F;

for (F = My->FileHead; F != NULL; F = F->next)
{
field_close_file (F);
file_clear (F);
}
}



/***************************************************************
@@ -890,13 +900,7 @@ bwb_CLOSE (LineType * Line)
if (line_is_eol (Line))
{
/* CLOSE */
FileType *F;

for (F = My->FileHead; F != NULL; F = F->next)
{
field_close_file (F);
file_clear (F);
}
bwb_close_all();
return (Line);
}



+ 7
- 0
bwb_var.c View File

@@ -368,6 +368,13 @@ extern void
var_CLEAR (void)
{
/*
Close all open file (variables)
*/
/* jaf-20211010 files should be closed when variables are cleared. */

bwb_close_all();

/*
free all variables except PRESET
*/
VariableType *variable;


+ 2
- 0
bwbasic.h View File

@@ -1598,6 +1598,7 @@ extern const size_t NUM_VERSIONS; /* upto 32 BASIC dialects */
#define T79 (1UL<<21) /* XBASIC */
#define H14 (1UL<<22) /* Haart */
#define B93 (1UL<<23) /* Bywater-2 */
#define VALL (0x00FFFFFF) /* ALL Vers */

/* OptionFlags */
#define OPTION_STRICT_ON 0x0001 /* Do NOT allow implicit DIM */
@@ -2145,6 +2146,7 @@ extern void bwb_clrexec (void);
extern void bwb_decexec (void);
extern void bwb_execline (void);
extern void bwb_fclose (FILE * file);
extern void bwb_close_all(void);
extern void bwb_file_open (char A, int x, char *B, int y);
extern int bwb_fload (char *FileName);
extern int bwb_freeline (LineType * l);


+ 2
- 2
bwd_cmd.c View File

@@ -476,7 +476,7 @@ CommandType IntrinsicCommandTable[ /* NUM_COMMANDS */ ] =
"EDIT", /* Syntax */
"implementation defined.", /* Description */
"EDIT", /* Name */
B15 | B93 | S70 | C77 | D64 | E78 | E86 | G74 | HB1 | HB2 | H80 | G65 | G67 | M80 | R86 | D71 | I70 | I73 | T80 | T79 /* OptionVersionBitmask */
VALL /* OptionVersionBitmask */
},
{
C_ELSE, /* UniqueID */
@@ -759,7 +759,7 @@ CommandType IntrinsicCommandTable[ /* NUM_COMMANDS */ ] =
"Provides help on the specified name which is a command name or "
"function name.", /* Description */
"HELP", /* Name */
B15 /* OptionVersionBitmask */
VALL /* OptionVersionBitmask */
},
{
C_IF, /* UniqueID */


+ 1
- 1
bwx_tty.c View File

@@ -111,7 +111,7 @@ bwx_COLOR (int Fore, int Back)
assert (My != NULL);
assert (My->SYSOUT != NULL);
assert (My->SYSOUT->cfp != NULL);
if (Fore < 0 || Back < 0)
if (Fore < 0 || Fore > 15 || Back < 0 || Back > 15)
{
WARN_ILLEGAL_FUNCTION_CALL;
return;


Loading…
Cancel
Save