The print/Print pair just cries out for a corresponding save/Save feature,

so implement the "missing" Save command -- save all the headers.
This commit is contained in:
ross 2002-03-29 15:10:02 +00:00
parent 3038d491a5
commit ecb9aca3ae
3 changed files with 22 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmd2.c,v 1.15 2002/03/05 21:29:30 wiz Exp $ */
/* $NetBSD: cmd2.c,v 1.16 2002/03/29 15:10:02 ross Exp $ */
/*
* Copyright (c) 1980, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cmd2.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: cmd2.c,v 1.15 2002/03/05 21:29:30 wiz Exp $");
__RCSID("$NetBSD: cmd2.c,v 1.16 2002/03/29 15:10:02 ross Exp $");
#endif
#endif /* not lint */
@ -145,6 +145,20 @@ save(void *v)
return save1(str, 1, "save", saveignore);
}
/*
* Save a message in a file. Mark the message as saved
* so we can discard when the user quits. Save all fields
* overriding saveignore and saveretain.
*/
int
Save(v)
void *v;
{
char *str = v;
return save1(str, 1, "Save", NULL);
}
/*
* Copy a message to a file without affected its saved-ness
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmdtab.c,v 1.8 1997/10/19 05:03:08 lukem Exp $ */
/* $NetBSD: cmdtab.c,v 1.9 2002/03/29 15:10:02 ross Exp $ */
/*
* Copyright (c) 1980, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cmdtab.c 8.2 (Berkeley) 4/20/95";
#else
__RCSID("$NetBSD: cmdtab.c,v 1.8 1997/10/19 05:03:08 lukem Exp $");
__RCSID("$NetBSD: cmdtab.c,v 1.9 2002/03/29 15:10:02 ross Exp $");
#endif
#endif /* not lint */
@ -79,6 +79,7 @@ const struct cmd cmdtab[] = {
{ "chdir", schdir, M|RAWLIST, 0, 1 },
{ "cd", schdir, M|RAWLIST, 0, 1 },
{ "save", save, STRLIST, 0, 0 },
{ "Save", Save, STRLIST, 0, 0 },
{ "source", source, M|RAWLIST, 1, 1 },
{ "set", set, M|RAWLIST, 0, 1000 },
{ "shell", dosh, I|NOLIST, 0, 0 },

View File

@ -1,4 +1,4 @@
/* $NetBSD: extern.h,v 1.15 2002/03/06 17:36:44 wiz Exp $ */
/* $NetBSD: extern.h,v 1.16 2002/03/29 15:10:03 ross Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* @(#)extern.h 8.2 (Berkeley) 4/20/95
* $NetBSD: extern.h,v 1.15 2002/03/06 17:36:44 wiz Exp $
* $NetBSD: extern.h,v 1.16 2002/03/29 15:10:03 ross Exp $
*/
struct name;
@ -213,6 +213,7 @@ int rexit(void *);
int rm(char *);
int run_command(char *, sigset_t *, int, int, char *, char *, char *);
int save(void *);
int Save(void *);
int save1(char [], int, char *, struct ignoretab *);
void savedeadletter(FILE *);
int saveigfield(void *);