diff options
author | lum <lum@cvs.openbsd.org> | 2012-08-31 18:06:43 +0000 |
---|---|---|
committer | lum <lum@cvs.openbsd.org> | 2012-08-31 18:06:43 +0000 |
commit | 07c43486af31c3270618486305239d78b3ffb5e9 (patch) | |
tree | 35bfb55cff75ec41095437e203f955d23177ae77 /usr.bin | |
parent | 4d8db0d18fc9843d41a3f41d1baa3e16aa112eae (diff) |
Allow an error message for a filename that is too long to be seen and
let the error stop mg exiting when C-x C-c is called.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mg/buffer.c | 4 | ||||
-rw-r--r-- | usr.bin/mg/def.h | 3 | ||||
-rw-r--r-- | usr.bin/mg/main.c | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/mg/buffer.c b/usr.bin/mg/buffer.c index c6c1a53b170..5a30aadbf0a 100644 --- a/usr.bin/mg/buffer.c +++ b/usr.bin/mg/buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buffer.c,v 1.80 2012/08/30 06:25:30 lum Exp $ */ +/* $OpenBSD: buffer.c,v 1.81 2012/08/31 18:06:42 lum Exp $ */ /* This file is in the public domain. */ @@ -459,7 +459,7 @@ anycb(int f) bp->b_fname); if (ret < 0 || ret >= sizeof(pbuf)) { ewprintf("Error: filename too long!"); - return (ABORT); + return (UERROR); } if ((f == TRUE || (save = eyorn(pbuf)) == TRUE) && (save2 = buffsave(bp)) == TRUE) { diff --git a/usr.bin/mg/def.h b/usr.bin/mg/def.h index 1284e943878..e00a0dd0b68 100644 --- a/usr.bin/mg/def.h +++ b/usr.bin/mg/def.h @@ -1,4 +1,4 @@ -/* $OpenBSD: def.h,v 1.124 2012/06/14 17:21:22 lum Exp $ */ +/* $OpenBSD: def.h,v 1.125 2012/08/31 18:06:42 lum Exp $ */ /* This file is in the public domain. */ @@ -36,6 +36,7 @@ typedef int (*PF)(int, int); /* generally useful type */ #define FALSE 0 /* False, no, bad, etc. */ #define TRUE 1 /* True, yes, good, etc. */ #define ABORT 2 /* Death, ^G, abort, etc. */ +#define UERROR 3 /* User Error. */ #define KCLEAR 2 /* clear echo area */ diff --git a/usr.bin/mg/main.c b/usr.bin/mg/main.c index 424d02718c1..ef4f3baa8dc 100644 --- a/usr.bin/mg/main.c +++ b/usr.bin/mg/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.68 2012/08/30 06:09:12 lum Exp $ */ +/* $OpenBSD: main.c,v 1.69 2012/08/31 18:06:42 lum Exp $ */ /* This file is in the public domain. */ @@ -224,7 +224,7 @@ quit(int f, int n) if ((s = anycb(FALSE)) == ABORT) return (ABORT); - if (s == FIOERR) + if (s == FIOERR || s == UERROR) return (FALSE); if (s == FALSE || eyesno("Modified buffers exist; really exit") == TRUE) { |