home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume14 / mp-2.4.5 / patch01 < prev    next >
Encoding:
Text File  |  1990-09-15  |  19.0 KB  |  533 lines

  1. Newsgroups: comp.sources.misc
  2. X-UNIX-From: rburridge@Sun.COM
  3. subject: v14i090: Official patch #6 for mp v2.4; please apply it.
  4. from: rburridge@Sun.COM (Rich Burridge)
  5. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  6.  
  7. Posting-number: Volume 14, Issue 90
  8. Submitted-by: rburridge@Sun.COM (Rich Burridge)
  9. Archive-name: mp-2.4.5/patch01
  10.  
  11. [Brandon, could you post this to comp.sources.misc please? I've already
  12.  posted a copy to comp.sources.bugs. Thanks].
  13.  
  14. Mp is a Postscript pretty printer for mail,news and ordinary files.
  15.  
  16. This is official patch #6 for mp v2.4.
  17.  
  18. ** Mp v2.4 was posted to comp.sources.misc last week at patchlevel #5. **
  19.  
  20. It makes the following changes:
  21.  
  22.     *  From Amos Shapir <amos@taux01.nsc.com>
  23.        Interpreting a '&' in the GECOS field should capitalize only the
  24.        first letter of the login name, not all of it.
  25.  
  26.     *  From Bruce G Barnett <barnett@unclejack.crd.ge.com>
  27.        From Pauline van Winsen <pauline@Aus.Sun.COM>
  28.        Mp only extracted two "words" from the user's passwd gecos field.
  29.        This has been changed to now extract three "words" by default, but
  30.        two new definitions have been added to the Makefile.dist file to
  31.        allow you to adjust the username extraction:
  32.  
  33.        GECOSFIELDS - Number of "words" extracted from the user's gecos field.
  34.        GECOSLENGTH - Maximum no. of chars. extracted from the gecos field.
  35.  
  36.        See the comments in the Makefile.dist file for more details.
  37.        If needed, then these options should be uncommented and set accordingly.
  38.        The README file has been updated.
  39.  
  40.     *  From Johan Vromans <jv@mh.nl>
  41.        An attempt to initialise the cc array in main.c when the variable
  42.        is declared doesn't work with the GNU C compiler. This has been
  43.        removed. Yes folks, this is deja vu.
  44.  
  45.     *  From Johan Vromans <jv@mh.nl>
  46.        To allow MP to handle A4 formatted pages, I made a few mods to
  47.        mp.pro.ps. The reason to introduce the variables fullwidth and
  48.        fullheight is that they are used in more than one location.
  49.        Reasonable values for fullwidth and fullheight are 8.5/11 inch for US
  50.        Letter, and 8.5/11.4 inch for A4.
  51.        Since sites usually have one single format of paper, mp could be
  52.        installed with either the USLetter or A4 values.
  53.  
  54.        I've also made the same modifications to mp.pro.alt.ps.
  55.  
  56.        **IMPORTANT NOTE** You should adjust these values correctly for your
  57.                           site. I've added a couple of comments to the
  58.                           "make install" to try to remind people about this.
  59.  
  60.        I've also left it defaulted at the US Letter size, so it should still
  61.        continue to work for A4 sites, but not use all of the paper.
  62.  
  63. TO INSTALL:
  64. -----------
  65.  
  66. Apply this patch with Larry Wall's patch program. Copy Makefile.dist to
  67. Makefile and adjust for your site. Then do a "make". Check the paper size
  68. in mp.pro.ps is correct for your site (US Letter or A4), then do a "make
  69. install".
  70.  
  71. Rich Burridge,          DOMAIN: richb@Aus.Sun.COM
  72. Sun Microsystems.       ACSNET: richb@sunaus.sun.oz
  73. PHONE: +61 2 413 2666   UUCP:   {uunet,mcvax,ukc}!munnari!sunaus.oz!richb
  74.  
  75. ------- README -------
  76. *** /tmp/da00708    Tue Sep  4 11:43:02 1990
  77. --- README    Tue Sep  4 11:01:17 1990
  78. ***************
  79. *** 47,54 ****
  80.   
  81.   These are:
  82.   
  83. ! PROLOGUE - Location of the mp prologue file (default: /usr/local/lib)
  84. ! NOINDEX  - uncomment if you don't have the index() function.
  85.   
  86.   See the Makefile for a detailed description of each of these definitions.
  87.   
  88. --- 47,56 ----
  89.   
  90.   These are:
  91.   
  92. ! GECOSFIELDS - Number of "words" extracted from the user's gecos field.
  93. ! GECOSLENGTH - Maximum number of characters extracted from the gecos field.
  94. ! NOINDEX     - uncomment if you don't have the index() function.
  95. ! PROLOGUE    - Location of the mp prologue file (default: /usr/local/lib)
  96.   
  97.   See the Makefile for a detailed description of each of these definitions.
  98.   
  99. ***************
  100. *** 81,88 ****
  101.   Avolio, Mark Prior, Stephen Frede, Craig Bishop, Jimmy Aitken, Hugues Leroy,
  102.   Bertrand Decouty, David Fiedler, Scott A. Jordahl, David Boone, Steve Cliffe,
  103.   Maureen Chew, Brian Kohn, Walter Underwood, Mike Khaw, Rick Gunderson, Johan
  104. ! Vromans, Brachet, Pierre Mareschal, Roger Riggs, Larry Tsui and Mike
  105. ! Bundschuh for bug reports and/or bug fixes plus enhancements.
  106.   
  107.   My thanks also goes to Glenn Reid from Adobe Systems for the backspacefont.ps
  108.   code used in the prologue files. I'm grateful to all these people, plus
  109. --- 83,91 ----
  110.   Avolio, Mark Prior, Stephen Frede, Craig Bishop, Jimmy Aitken, Hugues Leroy,
  111.   Bertrand Decouty, David Fiedler, Scott A. Jordahl, David Boone, Steve Cliffe,
  112.   Maureen Chew, Brian Kohn, Walter Underwood, Mike Khaw, Rick Gunderson, Johan
  113. ! Vromans, Brachet, Pierre Mareschal, Roger Riggs, Larry Tsui, Mike Bundschuh,
  114. ! Amos Shapir, Bruce G Barnett and Pauline van Winsen for bug reports and/or
  115. ! bug fixes plus enhancements.
  116.   
  117.   My thanks also goes to Glenn Reid from Adobe Systems for the backspacefont.ps
  118.   code used in the prologue files. I'm grateful to all these people, plus
  119.  
  120. ------- mp.pro.ps -------
  121. *** /tmp/da00711    Tue Sep  4 11:43:03 1990
  122. --- mp.pro.ps    Tue Sep  4 11:41:20 1990
  123. ***************
  124. *** 10,19 ****
  125.   %%EndComments
  126.   
  127.   /inch { 72 mul } def
  128.   /leftedge 0 def
  129. ! /rightedge 8.5 inch def
  130.   /bottomedge 0 def
  131. ! /topedge 11 inch def
  132.   /LandscapeMode false def
  133.   
  134.   %Title: backspacefont.ps suggested by Glenn Reid (Adobe Systems).
  135. --- 10,29 ----
  136.   %%EndComments
  137.   
  138.   /inch { 72 mul } def
  139. + %
  140. + %  IMPORTANT NOTE: The following two variables should be set correctly.
  141. + %                  Reasonable values for fullwidth and fullheight are
  142. + %                  8.5/11 inch for US Letter, and 8.5/11.4 inch for A4.
  143. + %                  Since sites usually have one single format of paper,
  144. + %                  mp should be installed with either the USLetter or A4
  145. + %                  values.
  146. + %
  147. + /fullwidth 8.5 inch def
  148. + /fullheight 11 inch def
  149.   /leftedge 0 def
  150. ! /rightedge fullwidth def
  151.   /bottomedge 0 def
  152. ! /topedge fullheight def
  153.   /LandscapeMode false def
  154.   
  155.   %Title: backspacefont.ps suggested by Glenn Reid (Adobe Systems).
  156. ***************
  157. *** 129,136 ****
  158.   /Landscape
  159.   {
  160.     /LandscapeMode true def
  161. !   /rightedge 11 inch def
  162. !   /topedge 8.5 inch def
  163.     newpage
  164.   } def
  165.   
  166. --- 139,146 ----
  167.   /Landscape
  168.   {
  169.     /LandscapeMode true def
  170. !   /rightedge fullheight def
  171. !   /topedge fullwidth def
  172.     newpage
  173.   } def
  174.   
  175.  
  176. ------- main.c -------
  177. *** /tmp/da00714    Tue Sep  4 11:43:03 1990
  178. --- main.c    Tue Sep  4 11:04:16 1990
  179. ***************
  180. *** 74,80 ****
  181.   char *apparently_from = NULL ;    /* Apparently_from: */
  182.   char *to[MAXCONT+1] ;             /* To: (can have multiple lines) */
  183.   char *apparently_to   = NULL ;    /* Apparently_to: */
  184. ! char *cc[MAXCONT+1]   = NULL ;    /* Cc: (can have multiple lines) */
  185.   char *subject         = NULL ;    /* Subject: (can be set from command line) */
  186.   char *gsubject        = NULL ;    /* Global subject set from command line. */
  187.   char *date            = NULL ;    /* Date: */
  188. --- 74,80 ----
  189.   char *apparently_from = NULL ;    /* Apparently_from: */
  190.   char *to[MAXCONT+1] ;             /* To: (can have multiple lines) */
  191.   char *apparently_to   = NULL ;    /* Apparently_to: */
  192. ! char *cc[MAXCONT+1] ;             /* Cc: (can have multiple lines) */
  193.   char *subject         = NULL ;    /* Subject: (can be set from command line) */
  194.   char *gsubject        = NULL ;    /* Global subject set from command line. */
  195.   char *date            = NULL ;    /* Date: */
  196.  
  197. ------- misc.c -------
  198. *** /tmp/da00717    Tue Sep  4 11:43:04 1990
  199. --- misc.c    Tue Sep  4 10:50:46 1990
  200. ***************
  201. *** 126,133 ****
  202. --- 126,147 ----
  203.     char *c, *ptr ;
  204.     int amp_cnt = 0 ;     /* Number of ampersands in gecos field. */
  205.     int i, j, n, spaces ;
  206. +   int namefields ;      /* Number of "words" from passwd gecos. */
  207. +   int namelength ;      /* Maximum number of characters from passwd gecos. */
  208.     struct passwd *pp ;
  209.   
  210. + #ifdef GECOSFIELDS
  211. +   namefields = GECOSFIELDS ;  /* New no. of "words" from passwd gecos. */
  212. + #else
  213. +   namefields = NAMEFIELDS ;   /* Not supplied; use default. */
  214. + #endif /*GECOSFIELDS*/
  215. + #ifdef GECOSLENGTH
  216. +   namelength = GECOSLENGTH ;  /* New max. no. of chars. from passwd gecos. */
  217. + #else
  218. +   namelength = NAMELENGTH ;   /* Not supplied; use default. */
  219. + #endif /*GECOSLENGTH*/
  220.     c = getlogin() ;      /* Pointer to users login name. */
  221.     if (c == NULL)        /* Get username from password file */
  222.       {
  223. ***************
  224. *** 141,147 ****
  225.   /*  Have a look for the users gecos (normally real name), so that its a bit
  226.    *  more recognisable. If this field is too long, then we need to truncate
  227.    *  sensibly. We also need to check a few things. If we've extracted
  228. !  *  two "words" or have found a comma, then exit. If an ampersand is
  229.    *  found, this is expanded to the users name in capitals.
  230.    */    
  231.        
  232. --- 155,161 ----
  233.   /*  Have a look for the users gecos (normally real name), so that its a bit
  234.    *  more recognisable. If this field is too long, then we need to truncate
  235.    *  sensibly. We also need to check a few things. If we've extracted
  236. !  *  three "words" or have found a comma, then exit. If an ampersand is
  237.    *  found, this is expanded to the users name in capitals.
  238.    */    
  239.        
  240. ***************
  241. *** 161,180 ****
  242.                  if (*ptr == ',') break ;
  243.             else if (*ptr == '&')
  244.               {
  245. !               for (j = 0; j < strlen(c); j++)
  246. !                 if (islower(c[j])) owner[n++] = toupper(c[j]) ;
  247. !                 else owner[n++] = c[j] ;
  248.                 *ptr++ ;
  249.               }
  250.             else if (*ptr == ' ')
  251.               {
  252. !               if (++spaces == 2) break ;
  253.                 else owner[n++] = *ptr++ ;
  254.               }
  255.             else owner[n++] = *ptr++ ;
  256. !           if (n >= NAMELENGTH) break ;
  257.           }
  258. !       if (n > NAMELENGTH) n = NAMELENGTH ;
  259.         owner[n] = '\0' ;
  260.       }
  261.     if ((nameptr = getenv("NAME")) != NULL)
  262. --- 175,194 ----
  263.                  if (*ptr == ',') break ;
  264.             else if (*ptr == '&')
  265.               {
  266. !               if (islower(c[0])) owner[n++] = toupper(c[0]) ;   
  267. !               for (j = 1; j < strlen(c); j++)                 
  268. !                 owner[n++] = c[j] ;
  269.                 *ptr++ ;
  270.               }
  271.             else if (*ptr == ' ')
  272.               {
  273. !               if (++spaces == namefields) break ;
  274.                 else owner[n++] = *ptr++ ;
  275.               }
  276.             else owner[n++] = *ptr++ ;
  277. !           if (n >= namelength) break ;
  278.           }
  279. !       if (n > namelength) n = namelength ;
  280.         owner[n] = '\0' ;
  281.       }
  282.     if ((nameptr = getenv("NAME")) != NULL)
  283.  
  284. ------- CHANGES -------
  285. *** /tmp/da00720    Tue Sep  4 11:43:05 1990
  286. --- CHANGES    Tue Sep  4 11:36:02 1990
  287. ***************
  288. *** 126,131 ****
  289. --- 126,133 ----
  290.   
  291.   v2.4 - patchlevel 5. - 29th August 1990.
  292.   
  293. +     *  Posted to comp.sources.misc.
  294.       *  From Larry W. Virden <lwv27%cas.BITNET@CUNYVM.CUNY.Edu>
  295.          Include a Makefile.dist with the mp distribution. This file will
  296.          need to be copied to Makefile and adjusted accordingly, but it does
  297. ***************
  298. *** 135,137 ****
  299. --- 137,182 ----
  300.       *  From Lupe Christoph <lupe@alanya.Germany.Sun.COM>
  301.          mp.pro.filofax.ps and mp.pro.timeman.ps still contained definitions
  302.          for PrimaryFont and SecondaryFont.
  303. + v2.4 - patchlevel 6. - 4th September 1990.
  304. +     *  From Amos Shapir <amos@taux01.nsc.com>
  305. +        Interpreting a '&' in the GECOS field should capitalize only the
  306. +        first letter of the login name, not all of it.
  307. +     *  From Bruce G Barnett <barnett@unclejack.crd.ge.com>
  308. +        From Pauline van Winsen <pauline@Aus.Sun.COM>
  309. +        Mp only extracted two "words" from the user's passwd gecos field.
  310. +        This has been changed to now extract three "words" by default, but
  311. +        two new definitions have been added to the Makefile.dist file to
  312. +        allow you to adjust the username extraction:
  313. +        GECOSFIELDS - Number of "words" extracted from the user's gecos field.
  314. +        GECOSLENGTH - Maximum no. of chars. extracted from the gecos field.
  315. +        See the comments in the Makefile.dist file for more details.
  316. +        If needed, then these options should be uncommented and set accordingly.
  317. +        The README file has been updated.
  318. +     *  From Johan Vromans <jv@mh.nl>
  319. +        An attempt to initialise the cc array in main.c when the variable
  320. +        is declared doesn't work with the GNU C compiler. This has been
  321. +        removed. Yes folks, this is deja vu.
  322. +     *  From Johan Vromans <jv@mh.nl>
  323. +        To allow MP to handle A4 formatted pages, I made a few mods to
  324. +        mp.pro.ps. The reason to introduce the variables fullwidth and
  325. +        fullheight is that they are used in more than one location.
  326. +        Reasonable values for fullwidth and fullheight are 8.5/11 inch for US
  327. +        Letter, and 8.5/11.4 inch for A4.
  328. +        Since sites usually have one single format of paper, mp could be
  329. +        installed with either the USLetter or A4 values.
  330. +        I've also made the same modifications to mp.pro.alt.ps.
  331. +        **IMPORTANT NOTE** You should adjust these values correctly for your
  332. +                           site. I've added a couple of comments to the
  333. +                           "make install" to try to remind people about this.
  334. +        I've also left it defaulted at the US Letter size, so it should still
  335. +        continue to work for A4 sites, but not use all of the paper.
  336.  
  337. ------- patchlevel.h -------
  338. *** /tmp/da00723    Tue Sep  4 11:43:05 1990
  339. --- patchlevel.h    Tue Sep  4 09:47:47 1990
  340. ***************
  341. *** 14,17 ****
  342.    *  reported to me then an attempt will be made to fix them.
  343.    */
  344.   
  345. ! #define  PATCHLEVEL  5
  346. --- 14,17 ----
  347.    *  reported to me then an attempt will be made to fix them.
  348.    */
  349.   
  350. ! #define  PATCHLEVEL  6
  351.  
  352. ------- mp.h -------
  353. *** /tmp/da00726    Tue Sep  4 11:43:06 1990
  354. --- mp.h    Tue Sep  4 10:20:27 1990
  355. ***************
  356. *** 59,64 ****
  357. --- 59,65 ----
  358.   
  359.   #define  MAXSIZES     4      /* Maximum number of different sizes. */
  360.   
  361. + #define  NAMEFIELDS   3      /* Default no. of "words" from passwd gecos. */
  362.   #define  NAMELENGTH   18     /* Maximum allowable real user name. */
  363.   #define  PAGELENGTH   60     /* Number of lines per page. */
  364.   #define  MAXCONT      10     /* Maximum no of continuation header lines */
  365.  
  366. ------- Makefile.dist -------
  367. *** /tmp/da00729    Tue Sep  4 11:43:06 1990
  368. --- Makefile.dist    Tue Sep  4 11:34:29 1990
  369. ***************
  370. *** 23,28 ****
  371. --- 23,46 ----
  372.   #
  373.   #PROLOGUE = -DPROLOGUE=\"$(LIBDIR)\"
  374.   #---------------------------------------------------------------------
  375. + #  Mp will extract the user's gecos field, and try to make sense of what
  376. + #  it finds. It applies various rules to do this. If this field is too long,
  377. + #  then it needs to truncate sensibly. If it's extracted N "words" or has
  378. + #  found a comma, then it stops extracting. If an ampersand is found, this
  379. + #  is expanded to the users name in capitals.
  380. + #  This option allows you to change the number of "words" that mp extracts
  381. + #  from the gecos field. By default this is 3. If needed, then it should
  382. + #  be uncommented, and set accordingly.
  383. + #
  384. + #GECOSFIELDS     = -DGECOSFIELDS=3
  385. + #---------------------------------------------------------------------
  386. + #  Mp will extract upto a certain number of characters from the user's
  387. + #  passwd gecos field. By default, this is 18. This option allows you to
  388. + #  set this to something different. If needed, then it should be uncommented,
  389. + #  and set accordingly.
  390. + #
  391. + #GECOSLENGTH     = -DGECOSLENGTH=18
  392. + #---------------------------------------------------------------------
  393.   #  Not all machines have the index() string library function. If you
  394.   #  don't have this function then you should uncomment the NOINDEX
  395.   #  definition below.
  396. ***************
  397. *** 40,46 ****
  398.   #
  399.   #  Compilation flags and standard macro definitions.
  400.   #
  401. ! CFLAGS   = -g $(NOINDEX) $(PROLOGUE)
  402.   LDFLAGS  =
  403.   #=================================================================
  404.   
  405. --- 58,64 ----
  406.   #
  407.   #  Compilation flags and standard macro definitions.
  408.   #
  409. ! CFLAGS   = -g $(GECOSFIELDS) $(GECOSLENGTH) $(NOINDEX) $(PROLOGUE)
  410.   LDFLAGS  =
  411.   #=================================================================
  412.   
  413. ***************
  414. *** 67,72 ****
  415. --- 85,98 ----
  416.          cc $(LDFLAGS) -o mp $(OBJS)
  417.   
  418.   install:   $(BINARIES)
  419. +        @echo
  420. +        @echo "**IMPORTANT NOTE**"
  421. +        @echo
  422. +        @echo "Mp is setup by default to work with US Letter sized paper."
  423. +        @echo "If you are using A4 sized paper, it is suggested that you"
  424. +        @echo "adjust the definitions of fullwidth and fullheight, at the"
  425. +        @echo "start of the mp.pro.ps file, then reinstall."
  426. +        @echo
  427.          install -s -m 751 mp $(BINDIR)
  428.          install -c -m 644 mp.1 $(MANDIR)/mp.$(MANSECT)
  429.          install -c -m 644 mp.pro.ps $(LIBDIR)
  430.  
  431. ------- TODO -------
  432. *** /tmp/da00732    Tue Sep  4 11:43:07 1990
  433. --- TODO    Tue Sep  4 11:40:09 1990
  434. ***************
  435. *** 41,43 ****
  436. --- 41,66 ----
  437.      Better, a short program that takes a general mp.pro.organiser.ps and
  438.      substitutes a few variables. Or you can use short PostScript fragments,
  439.      one for each personal organisers.
  440. + 7/ From Lupe Christoph <lupe@alanya.Germany.Sun.COM>
  441. +    The Time Manager and Filofax prologue files don't work correctly with
  442. +    printers that are setup for page reversal. The solution (which I've
  443. +    yet to implement), comes from Johan Vromans:
  444. +    "The problem is caused by the fact that you insert a "%Page: ? nn"
  445. +     before each *LOGICAL* page. It should be inserted only before *PHYSICAL*
  446. +     pages.  For filofax and timemanager (3 cols/page) that means that you
  447. +     need something like:
  448. +         %% Preamble
  449. +         %%Page: ? 1
  450. +         ..page1..
  451. +         endpage
  452. +         ..page2..
  453. +         endpage
  454. +         ..page3..
  455. +         endpage
  456. +         %%Page: ? 2
  457. +         ..page4..
  458. +         endpage
  459. +         ..."
  460.  
  461. ------- mp.pro.alt.ps -------
  462. *** /tmp/da00735    Tue Sep  4 11:43:07 1990
  463. --- mp.pro.alt.ps    Tue Sep  4 11:41:33 1990
  464. ***************
  465. *** 10,19 ****
  466.   %%EndComments
  467.   
  468.   /inch { 72 mul } def
  469.   /leftedge 0 def
  470. ! /rightedge 8.5 inch def
  471.   /bottomedge 0 def
  472. ! /topedge 11 inch def
  473.   /LandscapeMode false def
  474.   
  475.   %Title: backspacefont.ps suggested by Glenn Reid (Adobe Systems).
  476. --- 10,29 ----
  477.   %%EndComments
  478.   
  479.   /inch { 72 mul } def
  480. + %
  481. + %  IMPORTANT NOTE: The following two variables should be set correctly.
  482. + %                  Reasonable values for fullwidth and fullheight are
  483. + %                  8.5/11 inch for US Letter, and 8.5/11.4 inch for A4.
  484. + %                  Since sites usually have one single format of paper,
  485. + %                  mp should be installed with either the USLetter or A4
  486. + %                  values.
  487. + %
  488. + /fullwidth 8.5 inch def
  489. + /fullheight 11 inch def
  490.   /leftedge 0 def
  491. ! /rightedge fullwidth def
  492.   /bottomedge 0 def
  493. ! /topedge fullheight def
  494.   /LandscapeMode false def
  495.   
  496.   %Title: backspacefont.ps suggested by Glenn Reid (Adobe Systems).
  497. ***************
  498. *** 122,129 ****
  499.   /Landscape
  500.   {
  501.     /LandscapeMode true def
  502. !   /rightedge 11 inch def
  503. !   /topedge 8.5 inch def
  504.     newpage
  505.   } def
  506.   
  507. --- 132,139 ----
  508.   /Landscape
  509.   {
  510.     /LandscapeMode true def
  511. !   /rightedge fullheight def
  512. !   /topedge fullwidth def
  513.     newpage
  514.   } def
  515.   
  516.  
  517.