1
0
Fork 0
mirror of https://github.com/vbatts/bvi.git synced 2025-08-02 07:30:28 +00:00

git ls-files | xargs sed -i 's/[ \t]*$//'

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2025-03-02 10:29:56 -05:00
parent 5ab3ef5609
commit 92a88a4b4b
18 changed files with 64 additions and 64 deletions

View file

@ -1,9 +1,9 @@
New in release 1.4.2 New in release 1.4.2
==================== ====================
This release is dedicated to Sven Guckes (*1967-04-06 +2022-02-20). This release is dedicated to Sven Guckes (*1967-04-06 +2022-02-20).
Sven was an enthusiastic Linux explainer, his particular passion was the console tools. Sven was an enthusiastic Linux explainer, his particular passion was the console tools.
I met Sven a couple of times. He always showed interest in the further development of I met Sven a couple of times. He always showed interest in the further development of
the bvi and liked to discuss new ideas. the bvi and liked to discuss new ideas.
R.I.P. Sven R.I.P. Sven
* :wq bug fixed * :wq bug fixed
@ -29,7 +29,7 @@ New in release 1.4.1rc
* Compile warning: implicit declaration of function save_chk fixed (SF bug #9) * Compile warning: implicit declaration of function save_chk fixed (SF bug #9)
* bmore seg fault on file not found fixed * bmore seg fault on file not found fixed
* set columns prevents filename display on the commandline fixed (SF bug #8) * set columns prevents filename display on the commandline fixed (SF bug #8)
* bmore new option -r * bmore new option -r
bvi new setting: set reverse bvi new setting: set reverse
Characters between 160 - 254 are displayed as "reverse video text" as used in Characters between 160 - 254 are displayed as "reverse video text" as used in
some legacy systems (Atari, Commodore, Apple II, etc). some legacy systems (Atari, Commodore, Apple II, etc).

View file

@ -8,7 +8,7 @@
# #
# Copyright (c) 1996-2022 by Gerhard Buergmann # Copyright (c) 1996-2022 by Gerhard Buergmann
# gerhard@puon.at # gerhard@puon.at
# #
# 1996-01-18 V 1.0.0 # 1996-01-18 V 1.0.0
# 1999-01-15 V 1.1.0 # 1999-01-15 V 1.1.0
# 1999-03-03 V 1.1.1 # 1999-03-03 V 1.1.1

4
README
View file

@ -9,7 +9,7 @@ and is distributed under the GPL (GNU Public License).
How to compile How to compile
============== ==============
You need the curses (ncurses) library for cursor movement on your system. You need the curses (ncurses) library for cursor movement on your system.
https://www.cyberciti.biz/faq/linux-install-ncurses-library-headers-on-debian-ubuntu-centos-fedora/ https://www.cyberciti.biz/faq/linux-install-ncurses-library-headers-on-debian-ubuntu-centos-fedora/
@ -37,7 +37,7 @@ Subscribe to the bvi mailing for support, updates and other news:
Send a blank email to bvi-subscribe@yahoogroups.com. You will receive a Send a blank email to bvi-subscribe@yahoogroups.com. You will receive a
subscription confirmation message. Simply reply this message and your subscription confirmation message. Simply reply this message and your
subscription will be complete. subscription will be complete.
--------------------------------------------------------------------------- ---------------------------------------------------------------------------

View file

@ -10,4 +10,4 @@
#undef NEED_PUTC_CHAR #undef NEED_PUTC_CHAR
#undef HAVE_NCURSES_TERM_H #undef HAVE_NCURSES_TERM_H

View file

@ -116,7 +116,7 @@ initterm()
no_intty = tcgetattr(fileno(stdin), &ostate); no_intty = tcgetattr(fileno(stdin), &ostate);
tcgetattr(fileno(stderr), &ostate); tcgetattr(fileno(stderr), &ostate);
nstate = ostate; nstate = ostate;
if (!no_tty) { if (!no_tty) {
ostate.c_lflag &= ~(ICANON|ECHO); ostate.c_lflag &= ~(ICANON|ECHO);

View file

@ -77,7 +77,7 @@ except that a header is printed before each file in a series.
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \-a .B \-a
ASCII mode: no hex representation of the contents. Non printable ASCII mode: no hex representation of the contents. Non printable
characters are displayed as a dot (.) characters are displayed as a dot (.)
.TP .TP
.B \-c .B \-c

22
bmore.c
View file

@ -141,7 +141,7 @@ main(argc, argv)
#endif #endif
poi = strrchr(argv[0], DELIM); poi = strrchr(argv[0], DELIM);
if (poi) strncpy(progname, ++poi, 9); if (poi) strncpy(progname, ++poi, 9);
else strncpy(progname, argv[0], 9); else strncpy(progname, argv[0], 9);
strtok(progname, "."); strtok(progname, ".");
@ -177,7 +177,7 @@ main(argc, argv)
break; break;
case 'r': r_flag++; case 'r': r_flag++;
break; break;
default: default:
usage(); usage();
} }
i++; i++;
@ -340,7 +340,7 @@ main(argc, argv)
fclose(curr_file); fclose(curr_file);
reset_tty(); reset_tty();
exit(exval); exit(exval);
case ':' : case ':' :
switch (colon) { switch (colon) {
case 'f': case 'f':
prompt = 0; prompt = 0;
@ -449,7 +449,7 @@ main(argc, argv)
bytepos = screen_home; bytepos = screen_home;
to_print = maxy; to_print = maxy;
break; break;
case '\\': case '\\':
if (ascii_flag) { if (ascii_flag) {
bmbeep(); bmbeep();
break; break;
@ -460,13 +460,13 @@ main(argc, argv)
if (rdline(ch, sstring)) break; if (rdline(ch, sstring)) break;
} }
case 'n': /**** Search Next ****/ case 'n': /**** Search Next ****/
case 'N': case 'N':
bmsearch(ch); bmsearch(ch);
/* /*
to_print--; to_print--;
*/ */
break; break;
case '\'': case '\'':
if (no_intty) { if (no_intty) {
bmbeep(); bmbeep();
} else { } else {
@ -502,13 +502,13 @@ main(argc, argv)
if (!no_intty) { if (!no_intty) {
cleartoeol(); cleartoeol();
if (ch == 'v') { if (ch == 'v') {
sprintf(string, "bvi +%lu %s", sprintf(string, "bvi +%lu %s",
(unsigned long)(screen_home + (unsigned long)(screen_home +
(maxy + 1) / 2 * out_len), name); (maxy + 1) / 2 * out_len), name);
} else { } else {
if (precount < 1) precount = bytepos - screen_home; if (precount < 1) precount = bytepos - screen_home;
sprintf(string, "bvi -b %lu -s %lu %s", sprintf(string, "bvi -b %lu -s %lu %s",
(unsigned long)screen_home, (unsigned long)screen_home,
(unsigned long)precount, name); (unsigned long)precount, name);
} }
doshell(string); doshell(string);
@ -656,7 +656,7 @@ putline(buf, num)
} }
PRINTF(" "); PRINTF(" ");
} }
// ASCII section // ASCII section
for (print_pos = 0; print_pos < num; print_pos++) { for (print_pos = 0; print_pos < num; print_pos++) {
++bytepos; ++bytepos;
@ -695,7 +695,7 @@ printout(lns)
int c, num; int c, num;
int doub = 0; int doub = 0;
static int flag; static int flag;
if (c_flag) { if (c_flag) {
clearscreen(); clearscreen();
} }

View file

@ -7,7 +7,7 @@
* 1999-08-21 V 1.2.0 final * 1999-08-21 V 1.2.0 final
* 2000-05-31 V 1.3.0 beta * 2000-05-31 V 1.3.0 beta
* 2000-10-04 V 1.3.0 final * 2000-10-04 V 1.3.0 final
* 2002-01-16 V 1.3.1 * 2002-01-16 V 1.3.1
* 2003-02-20 V 1.3.2 * 2003-02-20 V 1.3.2
* 2010-03-28 V 1.3.4 * 2010-03-28 V 1.3.4
* 2019-01-22 V 1.4.1 * 2019-01-22 V 1.4.1

32
bvi.1
View file

@ -79,9 +79,9 @@
'br\} 'br\}
.\" If the F register is turned on, we'll generate .\" If the F register is turned on, we'll generate
.\" index entries out stderr for the following things: .\" index entries out stderr for the following things:
.\" TH Title .\" TH Title
.\" SH Header .\" SH Header
.\" Sh Subsection .\" Sh Subsection
.\" Ip Item .\" Ip Item
.\" X<> Xref (embedded .\" X<> Xref (embedded
.\" Of course, you have to process the output yourself .\" Of course, you have to process the output yourself
@ -203,10 +203,10 @@ bvi-1.4.1
.IX Header "OPTIONS" .IX Header "OPTIONS"
.Ip "\fIfile\fR..." 4 .Ip "\fIfile\fR..." 4
.IX Item "\fIfile\fR..." .IX Item "\fIfile\fR..."
A list of filenames. The first one will be the current file and A list of filenames. The first one will be the current file and
will be read will be read
into the buffer. The cursor will be positioned on the first line of into the buffer. The cursor will be positioned on the first line of
the buffer. You can get to the other files with the ":next" command. the buffer. You can get to the other files with the ":next" command.
.Ip "\fB\-R\fR" 4 .Ip "\fB\-R\fR" 4
.IX Item "\fB\-R\fR" .IX Item "\fB\-R\fR"
\*(L"Readonly": The readonly flag is set for all the files, \*(L"Readonly": The readonly flag is set for all the files,
@ -261,7 +261,7 @@ The byte offset (extreme left), the hex pane (middle),
and an ascii pane (right) which shows as printable characters and an ascii pane (right) which shows as printable characters
those bytes in the hex pane. those bytes in the hex pane.
On an 80 column terminal there will be sixteen hex values On an 80 column terminal there will be sixteen hex values
and their ASCII values on each screen line. and their ASCII values on each screen line.
Note that (as one would expect) the first byte has the offset \*(L'0\*(R' (zero). Note that (as one would expect) the first byte has the offset \*(L'0\*(R' (zero).
.PP .PP
You can toggle between the hex and ascii windows with the tab key (TAB). You can toggle between the hex and ascii windows with the tab key (TAB).
@ -270,7 +270,7 @@ position (offset) within the file.
.PP .PP
No \*(L"lines\*(R" concept: No \*(L"lines\*(R" concept:
Files are treated as one long stream of bytes. The characters Files are treated as one long stream of bytes. The characters
\*(L"newline\*(R" and \*(L"carriage return\*(R" are not special, id est they \*(L"newline\*(R" and \*(L"carriage return\*(R" are not special, id est they
never mark the end of lines. Therefore the lines on the screen do not never mark the end of lines. Therefore the lines on the screen do not
represent lines in the usual way. Data is broken across screen lines represent lines in the usual way. Data is broken across screen lines
arbitarily. arbitarily.
@ -319,7 +319,7 @@ Spaces between hex value are optional, so searching
for \*(L"6775636B6573\*(R" will find \*(L"guckes\*(R". for \*(L"6775636B6573\*(R" will find \*(L"guckes\*(R".
.PP .PP
Changing the length of data (insertion, deletion) moves the data to other addresses; Changing the length of data (insertion, deletion) moves the data to other addresses;
this is bad for many cases (eg. databases, program files) and is this is bad for many cases (eg. databases, program files) and is
thus disabled by default. You can enable this commands by typing thus disabled by default. You can enable this commands by typing
.PP .PP
\f(CW :set memmove\fR \f(CW :set memmove\fR
@ -334,11 +334,11 @@ Use ESC (escape) to cancel a partial (uncompleted) command.
.PP .PP
Input Mode: Input Mode:
.PP .PP
Input is treated as replacement of current characters or Input is treated as replacement of current characters or
(after the end of the file) is appended (after the end of the file) is appended
to the current file. This mode is entered from command mode by to the current file. This mode is entered from command mode by
typing one of \*(L'i\*(R', \*(L'I\*(R', \*(L'A\*(R', \*(L'r\*(R', or \*(L'R\*(R'. typing one of \*(L'i\*(R', \*(L'I\*(R', \*(L'A\*(R', \*(L'r\*(R', or \*(L'R\*(R'.
You can enter the characters from the keyboard (in the ASCII window) or You can enter the characters from the keyboard (in the ASCII window) or
hexadecimal values (in the HEX window). hexadecimal values (in the HEX window).
Type TAB to switch between these two windows. Type TAB to switch between these two windows.
Type ESC to finish the current input and return to command mode. Type ESC to finish the current input and return to command mode.
@ -346,8 +346,8 @@ Type CTRL\-C to cancel current command abnormally.
.PP .PP
Command line mode (Last Line Mode or : mode): Command line mode (Last Line Mode or : mode):
.PP .PP
Similar to vi, this mode is entered by typing one of the Similar to vi, this mode is entered by typing one of the
characters characters
: / ? \e # ! : / ? \e # !
The command is terminated and executed by typing a carriage The command is terminated and executed by typing a carriage
return; to cancel a partially typed command, type return; to cancel a partially typed command, type
@ -439,10 +439,10 @@ used within the following description of commands.
You can insert/append/change bytes in ASCII/binary/decimal/ You can insert/append/change bytes in ASCII/binary/decimal/
hexadecimal or octal representation. You can enter several hexadecimal or octal representation. You can enter several
(screen) lines of input. A line with only a period (.) in it (screen) lines of input. A line with only a period (.) in it
will terminate the command. You must not type in values greater will terminate the command. You must not type in values greater
than a byte value. This causes an abandonment of the command. than a byte value. This causes an abandonment of the command.
Pressing the CR key does not insert a newline \- character into Pressing the CR key does not insert a newline \- character into
the file. If you use ASCII mode you can use the special characters the file. If you use ASCII mode you can use the special characters
\en, \er, \et and \e0. \en, \er, \et and \e0.
.PP .PP
.Vb 3 .Vb 3
@ -507,7 +507,7 @@ the file. If you use ASCII mode you can use the special characters
`\fIx\fR move cursor to mark \fIx\fR in HEX section `\fIx\fR move cursor to mark \fIx\fR in HEX section
\*(L'\*(R' move cursor to previous context in ASCII section \*(L'\*(R' move cursor to previous context in ASCII section
`` move cursor to previous context in HEX section `` move cursor to previous context in HEX section
\fBLine positioning:\fR \fBLine positioning:\fR
H jump to first line on screen ("top") H jump to first line on screen ("top")
L jump to last line on screen ("low") L jump to last line on screen ("low")
@ -583,7 +583,7 @@ the file. If you use ASCII mode you can use the special characters
\& columns cm=16 on an 80 character wide terminal \& columns cm=16 on an 80 character wide terminal
\& ignorecase noic Ignores letter case in searching \& ignorecase noic Ignores letter case in searching
\& magic nomagic Makes . [ * special in patterns \& magic nomagic Makes . [ * special in patterns
\& memmove nomm enables insert and delete commands \& memmove nomm enables insert and delete commands
\& offset of=0 adds an offset to the diplayed addresses \& offset of=0 adds an offset to the diplayed addresses
\& readonly noro If set, write fails unless you use ! after command \& readonly noro If set, write fails unless you use ! after command
\& reverse nore display otherwise-printable characters with their \& reverse nore display otherwise-printable characters with their

16
bvi.c
View file

@ -2,7 +2,7 @@
* *
* 1996-02-28 V 1.0.0 * 1996-02-28 V 1.0.0
* 1999-01-27 V 1.1.0 * 1999-01-27 V 1.1.0
* 1999-04-22 V 1.1.1 * 1999-04-22 V 1.1.1
* 1999-07-01 V 1.2.0 beta * 1999-07-01 V 1.2.0 beta
* 1999-10-22 V 1.2.0 final * 1999-10-22 V 1.2.0 final
* 2000-05-10 V 1.3.0 alpha * 2000-05-10 V 1.3.0 alpha
@ -310,7 +310,7 @@ main(argc, argv)
if (*cmdstr != '\0') if (*cmdstr != '\0')
docmdline(cmdstr); docmdline(cmdstr);
msg(fname_buf); msg(fname_buf);
/* main loop */ /* main loop */
do { do {
setjmp(env); setjmp(env);
@ -491,9 +491,9 @@ main(argc, argv)
break; break;
case ';': do_ft(0, 0); case ';': do_ft(0, 0);
break; break;
case 'F': case 'F':
case 'f': case 'f':
case 't': case 't':
case 'T': do_ft(ch, 0); case 'T': do_ft(ch, 0);
break; break;
case 'G': last_motion = current; case 'G': last_motion = current;
@ -501,10 +501,10 @@ main(argc, argv)
if ((precount < P(P_OF)) || if ((precount < P(P_OF)) ||
(precount - P(P_OF)) > (filesize - 1L)) { (precount - P(P_OF)) > (filesize - 1L)) {
beep(); beep();
} else { } else {
setpage((PTR)(mem + precount - P(P_OF))); setpage((PTR)(mem + precount - P(P_OF)));
} }
} else { } else {
setpage((PTR)(mem + filesize - 1L)); setpage((PTR)(mem + filesize - 1L));
} }
break; break;
@ -1033,7 +1033,7 @@ range(ch)
- (off_t)P(P_OF)) > (filesize - 1L)) { - (off_t)P(P_OF)) > (filesize - 1L)) {
beep(); beep();
return 0; return 0;
} else { } else {
if (mem + count < current) { if (mem + count < current) {
return(mem + count - current); return(mem + count - current);
} else { } else {

4
comm.c
View file

@ -8,7 +8,7 @@
* 1999-09-10 V 1.2.0 final * 1999-09-10 V 1.2.0 final
* 2000-03-03 V 1.3.0 beta * 2000-03-03 V 1.3.0 beta
* 2000-07-15 V 1.3.0 final * 2000-07-15 V 1.3.0 final
* 2001-10-10 V 1.3.1 * 2001-10-10 V 1.3.1
* 2003-07-04 V 1.3.2 * 2003-07-04 V 1.3.2
* 2005-08-17 V 1.3.3 * 2005-08-17 V 1.3.3
* 2010-06-02 V 1.3.4 * 2010-06-02 V 1.3.4
@ -286,7 +286,7 @@ docmdline(cmdline)
if ((c_argv[c_argc] = strtok(cmd, " \t")) != NULL) c_argc++; if ((c_argv[c_argc] = strtok(cmd, " \t")) != NULL) c_argc++;
while ((c_argv[c_argc] = strtok(NULL, " \t")) != NULL) c_argc++; while ((c_argv[c_argc] = strtok(NULL, " \t")) != NULL) c_argc++;
if (c_argc > 1) { if (c_argc > 1) {
emsg(ambigous); emsg(ambigous);
return; } return; }
if (c_argc == 1) { if (c_argc == 1) {

View file

@ -11,7 +11,7 @@
#undef NEED_PUTC_CHAR #undef NEED_PUTC_CHAR
#undef HAVE_NCURSES_TERM_H #undef HAVE_NCURSES_TERM_H
/* Define to 1 if you have the <fcntl.h> header file. */ /* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H #undef HAVE_FCNTL_H

12
edit.c
View file

@ -117,7 +117,7 @@ edit(mode)
setcur(); setcur();
continue; continue;
} }
if (ch == KEY_BACKSPACE if (ch == KEY_BACKSPACE
|| ch == ASCII_DEL || ch == ASCII_DEL
|| ch == BVICTRL('H')) { || ch == BVICTRL('H')) {
if (count > 0) { if (count > 0) {
@ -483,7 +483,7 @@ statpos()
} }
} }
bin_val[8] = '\0'; bin_val[8] = '\0';
sprintf(string, "%08llX %s \\%03o 0x%02X %3d ", sprintf(string, "%08llX %s \\%03o 0x%02X %3d ",
(long long)(bytepos + P(P_OF)), bin_val, Char1, Char1, Char1); (long long)(bytepos + P(P_OF)), bin_val, Char1, Char1, Char1);
attrset(A_BOLD); attrset(A_BOLD);
@ -788,8 +788,8 @@ fileinfo(fname)
if (edits) strcat(string, "[Modified] "); if (edits) strcat(string, "[Modified] ");
if (filesize) { if (filesize) {
bytepos = (pagepos + y * Anzahl + xpos()) - mem + 1L; bytepos = (pagepos + y * Anzahl + xpos()) - mem + 1L;
sprintf(fstatus, "byte %llu of %llu --%llu%%--", sprintf(fstatus, "byte %llu of %llu --%llu%%--",
(unsigned long long)bytepos, (unsigned long long)bytepos,
(unsigned long long)filesize, (unsigned long long)filesize,
(unsigned long long)(bytepos * 100L / filesize)); (unsigned long long)(bytepos * 100L / filesize));
strcat(string, fstatus); strcat(string, fstatus);
@ -960,7 +960,7 @@ do_ins_chg(start, arg, mode)
*(tempbuf + count++) = val; *(tempbuf + count++) = val;
} }
} else { } else {
while (isspace(cmdstr[strlen(cmdstr) - 1])) while (isspace(cmdstr[strlen(cmdstr) - 1]))
cmdstr[strlen(cmdstr) - 1] = '\0'; cmdstr[strlen(cmdstr) - 1] = '\0';
while (*poi != '\0') { while (*poi != '\0') {
val = strtol(poi, &epoi, base); val = strtol(poi, &epoi, base);
@ -1025,7 +1025,7 @@ do_mark(mark, addr)
int mark; int mark;
PTR addr; PTR addr;
{ {
if (mark < 'a' || mark > 'z' || current >= maxpos) if (mark < 'a' || mark > 'z' || current >= maxpos)
return; return;
markbuf[mark - 'a'] = addr; markbuf[mark - 'a'] = addr;
} }

4
io.c
View file

@ -333,7 +333,7 @@ load(fname)
} }
/* argument "dir" not used! /* argument "dir" not used!
* Needed for DOS version only * Needed for DOS version only
*/ */
void void
@ -352,7 +352,7 @@ bvi_init(dir)
docmdline(initstr); docmdline(initstr);
return; return;
} }
#ifdef DJGPP #ifdef DJGPP
strcpy(rcpath, "c:"); strcpy(rcpath, "c:");
strcpy(rcpath, dir); strcpy(rcpath, dir);

2
re.c
View file

@ -32,7 +32,7 @@
/* You cannot use a common regexp subroutine, because \0 is a regular /* You cannot use a common regexp subroutine, because \0 is a regular
* character in a binary string ! * character in a binary string !
*/ */
#include "bvi.h" #include "bvi.h"
#include "set.h" #include "set.h"

View file

@ -26,7 +26,7 @@
/* You cannot use a common regexp subroutine, because \0 is a regular /* You cannot use a common regexp subroutine, because \0 is a regular
* character in a binary string ! * character in a binary string !
*/ */
#include "bvi.h" #include "bvi.h"
#include "set.h" #include "set.h"

12
set.c
View file

@ -9,13 +9,13 @@
* 1999-07-02 V 1.2.0 beta * 1999-07-02 V 1.2.0 beta
* 1999-08-14 V 1.2.0 final * 1999-08-14 V 1.2.0 final
* 2000-07-15 V 1.3.0 final * 2000-07-15 V 1.3.0 final
* 2001-10-10 V 1.3.1 * 2001-10-10 V 1.3.1
* 2003-07-03 V 1.3.2 * 2003-07-03 V 1.3.2
* 2010-06-02 V 1.2.4 * 2010-06-02 V 1.2.4
* 2014-09-30 V 1.4.0 * 2014-09-30 V 1.4.0
* 2019-01-22 V 1.4.1 * 2019-01-22 V 1.4.1
* *
* Copyright 1996-2019 by Gerhard Buergmann * Copyright 1996-2019 by Gerhard Buergmann
* gerhard@puon.at * gerhard@puon.at
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
@ -289,13 +289,13 @@ do_logic(mode, str)
b = a >> 8; b = a >> 8;
a |= b; a |= b;
break; break;
case RROTATE: case RROTATE:
b = a << 8; b = a << 8;
a |= b; a |= b;
a >>= value; a >>= value;
/* /*
b = a << (8 - value); b = a << (8 - value);
a >>= value; a >>= value;
a |= b; a |= b;
*/ */
break; break;
@ -303,7 +303,7 @@ do_logic(mode, str)
break; break;
case OR: a |= value; case OR: a |= value;
break; break;
case XOR: case XOR:
case NOT: a ^= value; case NOT: a ^= value;
break; break;
case NEG: a ^= value; case NEG: a ^= value;

BIN
testfile

Binary file not shown.