6863498 The "standard input" doesn't get printed to "Title:" even if the data is given to lp via its stdin
authorsonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
Thu, 24 Sep 2009 11:23:12 +0530
changeset 10634 6f69eed61369
parent 10633 62ff2de09191
child 10635 bff95ace2bd8
6863498 The "standard input" doesn't get printed to "Title:" even if the data is given to lp via its stdin
usr/src/cmd/lp/cmd/lpsched/disp1.c
--- a/usr/src/cmd/lp/cmd/lpsched/disp1.c	Wed Sep 23 22:00:30 2009 -0700
+++ b/usr/src/cmd/lp/cmd/lpsched/disp1.c	Thu Sep 24 11:23:12 2009 +0530
@@ -226,17 +226,14 @@
 					rp->request->title =
 					    Strdup(*rp->request->file_list);
 				else {
-					char *r;
-
-					if (r = strrchr(
-					    *rp->request->file_list, '/'))
-						r++;
-					else
-						r = *rp->request->file_list;
-
+					/*
+					 * In case of standard input
+					 * the title page should be
+					 * 'standard input'
+					 */
 					rp->request->title = malloc(25);
 					sprintf(rp->request->title,
-					    "%-.24s", r);
+					    "%-.24s", "standard input");
 				}
 			}