Skip to content

Commit

Permalink
Doc and variable naming consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwsw committed Sep 16, 2023
1 parent 974468f commit cf45a59
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
6 changes: 5 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@

* Fix crash if files are deleted while less is viewing them (github #404).

* Workaround unreliable ReadConsoleInputW behavior with non-ASCII input.
* Workaround unreliable ReadConsoleInputW behavior on Windows
with non-ASCII input.

* Fix -J display when searching for non-ASCII characters (github #422).

* Don't filter header lines via the & command (github #423).

* Fix bug when horizontally shifting long lines (github #425).

* Add -x and -D options to lesstest, to make it easier to diagnose
a failed lesstest run.

======================================================================

Major changes between "less" versions 633 and 643
Expand Down
2 changes: 1 addition & 1 deletion less.hlp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
Use _C instead of ^X to interrupt a read.
--line-num-width=_N
Set the width of the -N line number field to _N characters.
--match-shift=_N
--match-shift=_N
Show at least _N characters to the left of a search match.
--modelines=_N
Read _N lines from the input file and look for vim modelines.
Expand Down
2 changes: 1 addition & 1 deletion lesstest/lesstest.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ typedef struct TestSetup {

typedef struct TestState {
byte* screen;
size_t screen_size;
size_t screen_len;
wchar ch;
} TestState;

Expand Down
8 changes: 4 additions & 4 deletions lesstest/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,10 @@ static int read_states(FILE* testfd, TestState** p_states) {
}
states = new_states;
}
states[num_states].screen_size = line_len-1;
states[num_states].screen = (byte*) malloc(states[num_states].screen_size);
states[num_states].screen_len = line_len-1;
states[num_states].screen = (byte*) malloc(states[num_states].screen_len);
states[num_states].ch = 0;
memcpy(states[num_states].screen, line+1, states[num_states].screen_size);
memcpy(states[num_states].screen, line+1, states[num_states].screen_len);
break;
case '+':
states[num_states].ch = (wchar) strtol(line+1, NULL, 16);
Expand Down Expand Up @@ -355,7 +355,7 @@ int explore_testfile(const char* ltfile) {
if (disp_td) {
display_screen(td->img_actual, td->len_actual, screen_width, screen_height);
} else {
display_screen(states[curr_state].screen, states[curr_state].screen_size, screen_width, screen_height);
display_screen(states[curr_state].screen, states[curr_state].screen_len, screen_width, screen_height);
}
wchar ch = read_wchar(ttyin);
if (ch == 'q') break;
Expand Down
2 changes: 1 addition & 1 deletion lesstest/runtest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use strict;

# Run one or more test files.
my $usage = "usage: runtest [-eE] [-d lesstest-dir] [-l less.exe] [-r temp-dir] [-s lt_screen] [-t lesstest] [-O lesstest-opts] [file.lt | dir]...\n";
my $usage = "usage: runtest [-eED] [-d lesstest-dir] [-l less.exe] [-r temp-dir] [-s lt_screen] [-t lesstest] [-O lesstest-opts] [file.lt | dir]...\n";

use Getopt::Std;
use File::Basename;
Expand Down
2 changes: 1 addition & 1 deletion position.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ static int pos_shift(POSITION linepos, int choff)
pos = forw_raw_line_len(linepos, choff, &line, &line_len);
if (pos == NULL_POSITION || line_len != choff)
return -1;
cvt_ops = get_cvt_ops(0);
cvt_ops = get_cvt_ops(0); /* {{ Passing 0 ignores SRCH_NO_REGEX; does it matter? }}
/* {{ It would be nice to be able to call cvt_text with dst=NULL, to avoid need to alloc a useless cline. }} */
cline = (char *) ecalloc(1, line_len);
cvt_text(cline, line, NULL, &line_len, cvt_ops);
Expand Down

0 comments on commit cf45a59

Please sign in to comment.