Skip to content

Commit

Permalink
Remove unused READ_NORECOVERY
Browse files Browse the repository at this point in the history
  • Loading branch information
zickgraf committed Nov 22, 2022
1 parent 6d3015f commit e75ee60
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
29 changes: 0 additions & 29 deletions src/streams.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,34 +815,6 @@ static Obj FuncREAD(Obj self, Obj inputObj)
}


/****************************************************************************
**
*F FuncREAD_NORECOVERY( <self>, <input> ) . . . . . . read a file or stream
**
** Read the current input and close the input stream. Disable the normal
** mechanism which ensures that quitting from a break loop gets you back to
** a live prompt. This is initially designed for the files read from the
** command line.
*/
static Obj FuncREAD_NORECOVERY(Obj self, Obj inputObj)
{
TypInputFile input;
if (!OpenInputFileOrStream(SELF_NAME, &input, inputObj))
return False;

// read the file
READ_INNER(&input);
if (!CloseInput(&input)) {
ErrorQuit("Panic: READ_NORECOVERY cannot close input", 0, 0);
}
if (STATE(UserHasQuit)) {
STATE(UserHasQuit) = FALSE; // stop recovery here
return Fail;
}
return True;
}


/****************************************************************************
**
*F FuncREAD_STREAM_LOOP( <self>, <instream>, <outstream> ) . . read a stream
Expand Down Expand Up @@ -1738,7 +1710,6 @@ FuncExecuteProcess(Obj self, Obj dir, Obj prg, Obj in, Obj out, Obj args)
static StructGVarFunc GVarFuncs[] = {

GVAR_FUNC_1ARGS(READ, input),
GVAR_FUNC_1ARGS(READ_NORECOVERY, input),
GVAR_FUNC_4ARGS(
READ_ALL_COMMANDS, instream, echo, capture, resultCallback),
GVAR_FUNC_2ARGS(READ_COMMAND_REAL, stream, echo),
Expand Down
9 changes: 0 additions & 9 deletions tst/testinstall/kernel/streams.tst
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,6 @@ gap> func := LastReadValue;;
gap> NameFunction(func);
"func"

#
gap> READ_NORECOVERY(fail);
Error, READ_NORECOVERY: <input> must be a string or an input stream (not the v\
alue 'fail')
gap> READ_NORECOVERY("/this/path/does/not/exist!");
false
gap> READ_NORECOVERY(InputTextString(""));
true

#
gap> READ_STREAM_LOOP(fail, fail, fail);
Error, READ_STREAM_LOOP: <instream> must be an input stream (not the value 'fa\
Expand Down

0 comments on commit e75ee60

Please sign in to comment.