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

bvi-1.5.0.src.tar.gz

6540716a1a3b2b9711635108da14b26baea488881d4a682121c0bddbba6b74cb  bvi-1.5.0.src.tar.gz

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Gerhard Bürgmann 2025-07-27 10:02:07 -04:00 committed by Vincent Batts
parent 75fc14b579
commit 50898d8d59
Signed by: vbatts
GPG key ID: E30EFAA812C6E5ED
28 changed files with 1936 additions and 1473 deletions

41
io.c
View file

@ -12,10 +12,11 @@
* 2014-05-03 V 1.4.0
* 2019-01-27 V 1.4.1
* 2022-03-09 V 1.4.2
* 2025-07-19 V 1.5.0
*
* NOTE: Edit this file with tabstop=4 !
*
* Copyright 1996-2022 by Gerhard Buergmann
* Copyright 1996-2025 by Gerhard Buergmann
* gerhard@puon.at
*
* This program is free software; you can redistribute it and/or modify it
@ -79,11 +80,7 @@ extern char *fname_buf;
/*********** Save the patched file ********************/
int
save(fname, start, end, flags)
char *fname;
char *start;
char *end;
int flags;
save(char *fname, char *start, char *end, int flags)
{
int fd;
char *string;
@ -167,8 +164,7 @@ save(fname, start, end, flags)
/* loads a file, returns the filesize */
off_t
load(fname)
char *fname;
load(char *fname)
{
int fd = -1;
//char *string;
@ -235,7 +231,7 @@ load(fname)
params[P_RO].flags |= P_CHANGED;
}
} else {
sysemsg(fname);
sysemsg(fname);
filemode = ERROR;
}
}
@ -333,12 +329,11 @@ load(fname)
}
/* argument "dir" not used!
/* argument "dir" not used!
* Needed for DOS version only
*/
void
bvi_init(dir)
char *dir;
bvi_init(char *dir)
{
char *initstr;
char rcpath[MAXCMD];
@ -352,7 +347,7 @@ bvi_init(dir)
docmdline(initstr);
return;
}
#ifdef DJGPP
strcpy(rcpath, "c:");
strcpy(rcpath, dir);
@ -378,8 +373,7 @@ bvi_init(dir)
int
enlarge(add)
off_t add;
enlarge(off_t add)
{
char *newmem;
off_t savecur, savepag, savemax, saveundo;
@ -428,11 +422,10 @@ do_shell()
#ifndef HAVE_STRDUP
char *
strdup(s)
char *s;
strdup(char *s)
{
char *p;
size_t n;
size_t n;
n = strlen(s) + 1;
if ((p = (char *)malloc(n)) != NULL)
@ -447,10 +440,7 @@ strdup(s)
* Copy contents of memory (with possible overlapping).
*/
char *
memmove(s1, s2, n)
char *s1;
char *s2;
size_t n;
memmove(char *s1, char *s2, size_t n)
{
bcopy(s2, s1, n);
return(s1);
@ -459,9 +449,7 @@ memmove(s1, s2, n)
off_t
alloc_buf(n, buffer)
off_t n;
char **buffer;
alloc_buf(off_t n, char **buffer)
{
if (*buffer == NULL) {
*buffer = (char *)malloc(n);
@ -477,8 +465,7 @@ alloc_buf(n, buffer)
int
addfile(fname)
char *fname;
addfile(char *fname)
{
int fd;
off_t oldsize;