From 412b2e54251ff6e20537f83b95c8ee76ea8c5c40 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Thu, 29 Mar 2012 18:18:21 +0200 Subject: [PATCH] Folded fileproc to constant `refile'. Also moved sbr/refile.c into uip/whatnow.c --- config/config.c | 7 ------- h/mh.h | 1 - h/prototypes.h | 1 - man/comp.man1 | 1 - man/forw.man1 | 1 - man/mh-profile.man5 | 20 -------------------- man/repl.man1 | 1 - man/whatnow.man1 | 5 ++--- sbr/Makefile.in | 2 +- sbr/readconfig.c | 1 - sbr/refile.c | 50 -------------------------------------------------- uip/mhparam.c | 1 - uip/spost.c | 6 +++--- uip/whatnow.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- 14 files changed, 50 insertions(+), 92 deletions(-) delete mode 100644 sbr/refile.c diff --git a/config/config.c b/config/config.c index 31acdbb..f38866b 100644 --- a/config/config.c +++ b/config/config.c @@ -113,13 +113,6 @@ char *mimetypequeryproc = "file -b --mime"; */ /* -** This program is usually called directly by users, but it is -** also invoked by the spost program to process an "Fcc", or by -** comp/repl/forw/dist to refile a draft message. -*/ -char *fileproc = "refile"; - -/* ** This is the default program invoked by a "list" or "display" response ** at the "What now?" prompt. It will be given the absolute pathname of ** the message to show. The string ``show -file'' is most likely what you diff --git a/h/mh.h b/h/mh.h index ac8e665..0530051 100644 --- a/h/mh.h +++ b/h/mh.h @@ -284,7 +284,6 @@ extern char *defaultfolder; extern char *digestcomps; extern char *distcomps; extern char *draftfolder; -extern char *fileproc; extern char *foldprot; extern char *forwcomps; extern char *inbox; diff --git a/h/prototypes.h b/h/prototypes.h index 973da67..ba33a03 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -85,7 +85,6 @@ void push(void); char *pwd(void); char *mhbasename(char *); void readconfig(struct node **, FILE *, char *, int); -int refile(char **, char *); void ruserpass(char *, char **, char **); int seq_addmsg(struct msgs *, char *, int, int, int); int seq_addsel(struct msgs *, char *, int, int); diff --git a/man/comp.man1 b/man/comp.man1 index 5c39a50..6258d20 100644 --- a/man/comp.man1 +++ b/man/comp.man1 @@ -161,7 +161,6 @@ will prevent any edit from occurring.) ^Draft\-Folder:~^To set the default draft folder ^Editor:~^To override the default editor ^Msg\-Protect:~^To set mode when creating a new message (draft) -^fileproc:~^Program to refile the message ^whatnowproc:~^Program to ask the \*(lqWhat now?\*(rq questions .fi diff --git a/man/forw.man1 b/man/forw.man1 index 7f9f952..628942d 100644 --- a/man/forw.man1 +++ b/man/forw.man1 @@ -195,7 +195,6 @@ User's Manual for more information on making digests. ^Draft\-Folder:~^To set the default draft\-folder ^Editor:~^To override the default editor ^Msg\-Protect:~^To set mode when creating a new message (draft) -^fileproc:~^Program to refile the message ^whatnowproc:~^Program to ask the \*(lqWhat now?\*(rq questions .fi diff --git a/man/mh-profile.man5 b/man/mh-profile.man5 index 65a2d6f..083222b 100644 --- a/man/mh-profile.man5 +++ b/man/mh-profile.man5 @@ -405,26 +405,6 @@ The profile can be used to select alternate programs if the user wishes. The default values are given in the examples. .RE .PP -.BR fileproc : -%bindir%/refile -.RS 5 -This program is used to refile or link a message to another folder. -It is used by -.B post -to file a copy of a message into a folder given -by a \*(lqFcc:\*(rq field. It is used by the draft folder facility in -.BR comp , -.BR dist , -.BR forw , -and -.B repl -to refile a draft -message into another folder. It is used to refile a draft message in -response to the -.B refile -directive at the \*(lqWhat now?\*(rq prompt. -.RE -.PP .BR listproc : show \-file .RS 5 diff --git a/man/repl.man1 b/man/repl.man1 index 5643286..26a2cdd 100644 --- a/man/repl.man1 +++ b/man/repl.man1 @@ -390,7 +390,6 @@ switch. ^Draft\-Folder:~^To set the default draft\-folder ^Editor:~^To override the default editor ^Msg\-Protect:~^To set mode when creating a new message (draft) -^fileproc:~^Program to refile the message ^whatnowproc:~^Program to ask the \*(lqWhat now?\*(rq questions .fi diff --git a/man/whatnow.man1 b/man/whatnow.man1 index 36844a0..0406e45 100644 --- a/man/whatnow.man1 +++ b/man/whatnow.man1 @@ -115,8 +115,8 @@ option). .PP For the .B refile -response, any valid switch to the -.I fileproc +response, any valid switch to +.B refile is valid. .PP See @@ -158,7 +158,6 @@ information. ^Editor:~^To override the default editor ^\-next:~^To name an editor to be used after exit ^~^from -^fileproc:~^Program to refile the message ^listproc:~^Program to list the contents of a message .fi diff --git a/sbr/Makefile.in b/sbr/Makefile.in index f2f1a9e..1f1b79b 100644 --- a/sbr/Makefile.in +++ b/sbr/Makefile.in @@ -60,7 +60,7 @@ SRCS = addrsbr.c ambigsw.c brkstring.c \ makedir.c mts.c norm_charmap.c \ path.c pidwait.c pidstatus.c \ print_help.c print_sw.c print_version.c \ - putenv.c refile.c mhbasename.c \ + putenv.c mhbasename.c \ readconfig.c ruserpass.c seq_add.c seq_bits.c \ seq_del.c seq_getnum.c seq_list.c seq_nameok.c \ seq_print.c seq_read.c seq_save.c seq_setcur.c \ diff --git a/sbr/readconfig.c b/sbr/readconfig.c index 280d25b..c238a26 100644 --- a/sbr/readconfig.c +++ b/sbr/readconfig.c @@ -22,7 +22,6 @@ static struct procstr procs[] = { { "backup-prefix", &backup_prefix }, { "draft-folder", &draftfolder }, { "altmsg-link", &altmsglink }, - { "fileproc", &fileproc }, { "listproc", &listproc }, { "sendmail", &sendmail }, { "trash-folder", &trashfolder }, diff --git a/sbr/refile.c b/sbr/refile.c deleted file mode 100644 index 55ba754..0000000 --- a/sbr/refile.c +++ /dev/null @@ -1,50 +0,0 @@ -/* -** refile.c -- call the "fileproc" to refile the -** -- msg or draft into another folder -** -** This code is Copyright (c) 2002, by the authors of nmh. See the -** COPYRIGHT file in the root directory of the nmh distribution for -** complete copyright information. -*/ - -#include - - -int -refile(char **arg, char *file) -{ - pid_t pid; - register int vecp; - char *vec[MAXARGS]; - - vecp = 0; - vec[vecp++] = mhbasename(fileproc); - vec[vecp++] = "-nolink"; /* override bad .mh_profile defaults */ - vec[vecp++] = "-nopreserve"; - vec[vecp++] = "-file"; - vec[vecp++] = file; - - if (arg) { - while (*arg) - vec[vecp++] = *arg++; - } - vec[vecp] = NULL; - - context_save(); /* save the context file */ - fflush(stdout); - - switch (pid = fork()) { - case -1: - advise("fork", "unable to"); - return -1; - - case 0: - execvp(fileproc, vec); - fprintf(stderr, "unable to exec "); - perror(fileproc); - _exit(-1); - - default: - return (pidwait(pid, -1)); - } -} diff --git a/uip/mhparam.c b/uip/mhparam.c index 7a1c512..664e5d0 100644 --- a/uip/mhparam.c +++ b/uip/mhparam.c @@ -37,7 +37,6 @@ static struct proc procs [] = { { "context", &context }, { "mh-sequences", &mh_seq }, { "editor", &defaulteditor }, - { "fileproc", &fileproc }, { "foldprot", &foldprot }, { "listproc", &listproc }, { "mimetypequeryproc", &mimetypequeryproc }, diff --git a/uip/spost.c b/uip/spost.c index 93283cc..369f03e 100644 --- a/uip/spost.c +++ b/uip/spost.c @@ -654,12 +654,12 @@ fcc(char *file, char *folders) folders); fflush(stdout); } - if (strlen(fileproc)+strlen(file)+strlen(folders)+100 > sizeof cmd) { + if (100+strlen(file)+strlen(folders) > sizeof cmd) { adios(NULL, "Too much Fcc data"); } /* hack: read from /dev/null and refile(1) won't question us */ - snprintf(cmd, sizeof cmd, "