Subversion Repositories SvarDOS

Compare Revisions

Ignore whitespace Rev 1452 → Rev 1453

/sved/trunk/makefile
12,6 → 12,8
LDFLAGS = -lr -mt -fm=sved.map -fe=sved.com
LDLIBS = svarlang\svarlngs.lib mdr\mdrs2023.lib
 
PVER = 2023.2
 
all: sved.com
 
sved.com: sved.obj deflang.obj
31,7 → 33,7
copy sved.com bin
copy sved.lng bin
copy sved.txt doc\sved
echo version: 2023.1 > appinfo\sved.lsm
echo version: $(PVER) > appinfo\sved.lsm
echo description: SvarDOS text editor >> appinfo\sved.lsm
zip -9rkDX -m sved.svp bin appinfo doc
rmdir doc\sved
/sved/trunk/sved.c
34,7 → 34,7
#include "svarlang\svarlang.h"
 
 
#define PVER "2023.1"
#define PVER "2023.2"
#define PDATE "2023"
 
/*****************************************************************************
745,8 → 745,8
}
 
 
static int savefile(const struct file *db, const char *newfname) {
int fd;
static int savefile(const struct file *db, const char *saveas) {
int fd = 0;
const struct line far *l;
unsigned int bytes;
unsigned char eollen;
753,13 → 753,30
unsigned char eolbuf[2];
int errflag = 0;
 
/* either create a new file if newfname provided, or... */
if (newfname) {
if (_dos_creatnew(newfname, _A_NORMAL, &fd) != 0) return(-1);
} else { /* ...open db->fname */
if (_dos_open(db->fname, O_WRONLY, &fd) != 0) return(-1);
/* if filename not overloaded then use the fname in db */
if (saveas == NULL) saveas = db->fname;
 
_asm {
push ax
push cx
push dx
 
mov ah, 0x3C /* create or truncate file */
xor cx, cx /* file attributes */
mov dx, saveas /* works only in SMALL/TINY mode */
int 0x21
jnc DONE
mov errflag, ax
DONE:
mov fd, ax
 
pop dx
pop cx
pop ax
}
 
if (errflag != 0) return(-1);
 
l = db->cursor;
while (l->prev) l = l->prev;
 
784,9 → 801,6
l = l->next;
}
 
/* emit a 0-bytes write - this means "truncate file at current position" */
errflag |= _dos_write(fd, NULL, 0, &bytes);
 
errflag |= _dos_close(fd);
 
return(errflag);
/sved/trunk/sved.txt
66,6 → 66,9
 
### CHANGELOG ################################################################
 
2023.2 [07 Aug 2023]
- fixed saving to new file passed on command-line
 
2023.1 [07 Aug 2023]
- fixed onscreen garbage when opening a non-existent file (sved notexist.txt)
- abort with error when an invalid filename is given as argument (sved *)