Sophie

Sophie

distrib > Altlinux > 4.1 > i586 > by-pkgid > db8c5bfeebba0837ac4f182908887b89 > files > 8

enscript-1.6.4-alt3.src.rpm

diff -Naur enscript-1.6.3.orig/src/main.c enscript-1.6.3/src/main.c
--- enscript-1.6.3.orig/src/main.c	2002-08-16 14:30:35 +0400
+++ enscript-1.6.3/src/main.c	2002-08-16 14:35:48 +0400
@@ -333,6 +333,8 @@
  * Send mail notification to user after print job has been completed.
  */
 int mail = 0;
+char *mail_name;
+
 
 /*
  * -M, --media
@@ -856,7 +858,7 @@
   {"no-page-prefeed",		no_argument,		0, 'K'},
   {"lineprinter",		no_argument,		0, 'l'},
   {"lines-per-page",		required_argument,	0, 'L'},
-  {"mail",			no_argument,		0, 'm'},
+  {"mail",			optional_argument,	0, 'm'},
   {"media",			required_argument,	0, 'M'},
   {"copies",			required_argument,	0, 'n'},
   {"newline",			required_argument,	0, 'N'},
@@ -1842,7 +1844,11 @@
       /* Format spooler options. */
       spooler_options[0] = '\0';
       if (mail)
-	strcat (spooler_options, "-m ");
+	{
+	  strcat (spooler_options, "-m ");
+	  strcat (spooler_options, mail_name);
+	  strcat (spooler_options, " ");
+	}
       if (no_job_header)
 	{
 	  strcat (spooler_options, no_job_header_switch);
@@ -2005,7 +2011,7 @@
       int i;
 
       c = getopt_long (argc, argv,
-		       "#:123456789a:A:b:BcC::d:D:e::E::f:F:gGhH::i:I:jJ:kKlL:mM:n:N:o:Op:P:qrRs:S:t:T:u::U:vVW:X:zZ",
+		       "#:123456789a:A:b:BcC::d:D:e::E::f:F:gGhH::i:I:jJ:kKlL:m:M:n:N:o:Op:P:qrRs:S:t:T:u::U:vVW:X:zZ",
 		       long_options, &option_index);
 
       if (c == -1)
@@ -2206,6 +2212,10 @@
 
 	case 'm':		/* send mail upon completion */
 	  mail = 1;
+	  if(optarg)
+	    mail_name = (optarg);
+	  else
+	    mail_name = (*passwd).pw_name;
 	  break;
 
 	case 'M':		/* select output media */