Skip to content

Commit

Permalink
Tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwsw committed Nov 29, 2022
1 parent 4f4686a commit 1ab5f9f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions less.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ typedef short POLL_EVENTS;

#define EOI (-1)

#define READ_ERR (-1)
#define READ_INTR (-2)
#define READ_AGAIN (-3)

Expand Down
25 changes: 14 additions & 11 deletions lesstest/README
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ of the simulated screen.
+------------------+ (tty) +------+ (outfd) +-------------+
| lesstest |--------------->| less |--------------->| lt_screen |
+------------------+ simulated +------+ simulated +-------------+
^ ^ user terminal
| |
| |
^ (stdin) | ^ user terminal
| | |
| v | (testfile)
+-----------+ +---------+
| developer | | LT file |
+-----------+ +---------+

lesstest runs in one of two modes: in the "maketest" mode it reads single
keystrokes from the developer and sends them to less. After each keystroke
it then reads the lt_screen screen contents and logs the keystroke and
the resulting screen contents to a log file, called an lt file.
In "runtest" mode, lesstest reads an lt file and "replays" the session;
that is, it reads a keystroke from the lt file and sends it to less.
After sending each keystroke, it reads the lt_screen screen contents and
compares it to the logged screen contents from the lt file.
lesstest runs in one of two modes:

In the "maketest" mode it reads single keystrokes from the developer
and sends them to less. After each keystroke it then reads the
lt_screen screen contents and logs the keystroke and the resulting
screen contents to a log file, called an lt file.

In the "runtest" mode, lesstest reads a previously-created lt file
and "replays" the session; that is, it first reads a keystroke from
the lt file and sends it to less. It then reads the lt_screen screen
contents and compares it to the logged screen contents from the lt file.
4 changes: 2 additions & 2 deletions os.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ iread(fd, buf, len)
if (select(fd+1, &readfds, 0, 0, 0) == -1)
{
reading = 0;
return (-1);
return (READ_ERR);
}
}
#endif
Expand Down Expand Up @@ -262,7 +262,7 @@ iread(fd, buf, len)
goto start;
#endif
#endif
return (-1);
return (READ_ERR);
}
return (n);
}
Expand Down

0 comments on commit 1ab5f9f

Please sign in to comment.