70 lines
1.6 KiB
Diff
70 lines
1.6 KiB
Diff
--- mblaze-1.2/mdeliver.c 2021-12-12 11:39:30.000000000 -0500
|
|
+++ mblaze-1.2f/mdeliver.c 2022-05-12 09:01:42.858863260 -0400
|
|
@@ -300,6 +300,23 @@ refile(char *file)
|
|
unlink(file);
|
|
}
|
|
|
|
+
|
|
+void
|
|
+mdelete(char *file)
|
|
+{
|
|
+ while (*file == ' ' || *file == '\t')
|
|
+ file++;
|
|
+
|
|
+ if (!kflag) {
|
|
+ unlink(file);
|
|
+ if (vflag)
|
|
+ fprintf(stderr, "Messages deleted.\n");
|
|
+ }
|
|
+
|
|
+ if (kflag)
|
|
+ fprintf(stderr, "Deletion command overridden.\n");
|
|
+}
|
|
+
|
|
int
|
|
main(int argc, char *argv[])
|
|
{
|
|
@@ -335,6 +352,32 @@ usage:
|
|
|
|
return 0;
|
|
}
|
|
+
|
|
+
|
|
+ if (strchr(argv[0], 't')) {
|
|
+ // mdelete(1)
|
|
+
|
|
+ int c;
|
|
+ while ((c = getopt(argc, argv, "kv")) != -1)
|
|
+ switch (c) {
|
|
+ case 'k': kflag = 1; break;
|
|
+ case 'v': vflag = 1; break;
|
|
+ default:
|
|
+usage3:
|
|
+ fprintf(stderr, "Usage: mdelete [-kv] [msgs]... \n");
|
|
+ exit(1);
|
|
+ }
|
|
+
|
|
+ if (argc == optind - 1)
|
|
+ goto usage3;
|
|
+
|
|
+ if (argc == optind && isatty(0))
|
|
+ goto usage3;
|
|
+ else
|
|
+ blaze822_loop(argc - optind, argv + optind, mdelete);
|
|
+
|
|
+ return 0;
|
|
+ }
|
|
|
|
int c;
|
|
while ((c = getopt(argc, argv, "cMvX:")) != -1)
|
|
--- mblaze-1.2/GNUmakefile 2021-12-12 11:39:30.000000000 -0500
|
|
+++ mblaze-1.2f/GNUmakefile 2022-05-12 09:02:48.345479146 -0400
|
|
@@ -62,6 +62,7 @@ install: FRC all
|
|
ln -sf mcom $(DESTDIR)$(BINDIR)/mfwd
|
|
ln -sf mcom $(DESTDIR)$(BINDIR)/mrep
|
|
ln -sf mdeliver $(DESTDIR)$(BINDIR)/mrefile
|
|
+ ln -sf mdeliver $(DESTDIR)$(BINDIR)/mdelete
|
|
install -m0644 man/*.1 $(DESTDIR)$(MANDIR)/man1
|
|
install -m0644 man/*.5 $(DESTDIR)$(MANDIR)/man5
|
|
install -m0644 man/*.7 $(DESTDIR)$(MANDIR)/man7
|