home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume4 / xcutbuf / patch1 next >
Encoding:
Internet Message Format  |  1989-05-21  |  8.3 KB

  1. Path: uunet!island!argv
  2. From: argv@island.uu.net (Dan Heller)
  3. Newsgroups: comp.sources.x
  4. Subject: v04i003:  xcutbuf, Patch1
  5. Message-ID: <760@island.uu.net>
  6. Date: 20 May 89 09:43:06 GMT
  7. Organization: Island Graphics, Marin County, California
  8. Lines: 442
  9. Approved: island!argv@sun.com
  10.  
  11. Submitted-by: Dave Curry <davy@riacs.edu>
  12. Posting-number: Volume 4, Issue 3
  13. Archive-name: xcutbuf/patch1
  14.  
  15. ***************
  16.  
  17. *** 1,5
  18.   /*
  19. !  * $Header: /usr/local/src/source/X.V11R3/contrib/clients/xcutbuf/RCS/patchlevel.h,v 1.1 89/05/02 11:04:40 davy Exp $
  20.    *
  21.    * patchlevel.h
  22.    *
  23.  
  24. --- 1,5 -----
  25.   /*
  26. !  * $Header: /usr/local/src/source/X.V11R3/contrib/clients/xcutbuf/RCS/patchlevel.h,v 1.2 89/05/08 09:48:34 davy Exp $
  27.    *
  28.    * patchlevel.h
  29.    *
  30. ***************
  31. *** 11,16
  32.    * davy@riacs.edu
  33.    *
  34.    * $Log:    patchlevel.h,v $
  35.    * Revision 1.1  89/05/02  11:04:40  davy
  36.    * Initial revision
  37.    * 
  38.  
  39. --- 11,19 -----
  40.    * davy@riacs.edu
  41.    *
  42.    * $Log:    patchlevel.h,v $
  43. +  * Revision 1.2  89/05/08  09:48:34  davy
  44. +  * Fix to avoid calling XFree with a null value.
  45. +  * 
  46.    * Revision 1.1  89/05/02  11:04:40  davy
  47.    * Initial revision
  48.    * 
  49. ***************
  50. *** 16,19
  51.    * 
  52.    */
  53.   
  54. ! #define PatchLevel    0
  55.  
  56. --- 19,22 -----
  57.    * 
  58.    */
  59.   
  60. ! #define PatchLevel    1
  61. *** /tmp/,RCSt1a07405    Mon May  8 09:49:59 1989
  62. --- xcutbuf.c    Mon May  8 09:48:52 1989
  63. ***************
  64. *** 1,5
  65.   #ifndef lint
  66. ! static char *RCSid = "$Header: /usr/local/src/source/X.V11R3/contrib/clients/xcutbuf/RCS/xcutbuf.c,v 1.1 89/05/02 11:04:47 davy Exp $";
  67.   #endif
  68.   /*
  69.    * xcutbuf - X11 cut buffer manager
  70.  
  71. --- 1,5 -----
  72.   #ifndef lint
  73. ! static char *RCSid = "$Header: /usr/local/src/source/X.V11R3/contrib/clients/xcutbuf/RCS/xcutbuf.c,v 1.2 89/05/08 09:48:49 davy Exp $";
  74.   #endif
  75.   /*
  76.    * xcutbuf - X11 cut buffer manager
  77. ***************
  78. *** 23,28
  79.    * davy@riacs.edu
  80.    *
  81.    * $Log:    xcutbuf.c,v $
  82.    * Revision 1.1  89/05/02  11:04:47  davy
  83.    * Initial revision
  84.    * 
  85.  
  86. --- 23,31 -----
  87.    * davy@riacs.edu
  88.    *
  89.    * $Log:    xcutbuf.c,v $
  90. +  * Revision 1.2  89/05/08  09:48:49  davy
  91. +  * Fix to avoid calling XFree with a null value.
  92. +  * 
  93.    * Revision 1.1  89/05/02  11:04:47  davy
  94.    * Initial revision
  95.    * 
  96. ***************
  97. *** 256,262
  98.               /*
  99.                * Free the X resource we got from XFetchBuffer.
  100.                */
  101. !             XFree(buffer);
  102.           }
  103.       }
  104.       else {
  105.  
  106. --- 259,266 -----
  107.               /*
  108.                * Free the X resource we got from XFetchBuffer.
  109.                */
  110. !             if (buffer)
  111. !                 XFree(buffer);
  112.           }
  113.       }
  114.       else {
  115. ***************
  116. *** 291,297
  117.           /*
  118.            * Free the X resource we got from XFetchBuffer.
  119.            */
  120. !         XFree(buffer);
  121.       }
  122.   }
  123.   
  124.  
  125. --- 295,302 -----
  126.           /*
  127.            * Free the X resource we got from XFetchBuffer.
  128.            */
  129. !         if (buffer)
  130. !             XFree(buffer);
  131.       }
  132.   }
  133.   
  134.  
  135. *** /tmp/,RCSt1a07683    Mon May  8 11:14:27 1989
  136. --- patchlevel.h    Mon May  8 11:09:49 1989
  137. ***************
  138. *** 1,5
  139.   /*
  140. !  * $Header: /usr/local/src/sun3/X.V11R3/contrib/clients/xcutbuf/RCS/patchlevel.h,v 1.2 89/05/08 09:48:34 davy Exp $
  141.    *
  142.    * patchlevel.h
  143.    *
  144.  
  145. --- 1,5 -----
  146.   /*
  147. !  * $Header: /usr/local/src/source/X.V11R3/contrib/clients/xcutbuf/RCS/patchlevel.h,v 1.3 89/05/08 11:09:27 davy Exp $
  148.    *
  149.    * patchlevel.h
  150.    *
  151. ***************
  152. *** 11,16
  153.    * davy@riacs.edu
  154.    *
  155.    * $Log:    patchlevel.h,v $
  156.    * Revision 1.2  89/05/08  09:48:34  davy
  157.    * Fix to avoid calling XFree with a null value.
  158.    * 
  159.  
  160. --- 11,19 -----
  161.    * davy@riacs.edu
  162.    *
  163.    * $Log:    patchlevel.h,v $
  164. +  * Revision 1.3  89/05/08  11:09:27  davy
  165. +  * Fixed to properly handle buffer numbers after -list, -contents, -rotate.
  166. +  * 
  167.    * Revision 1.2  89/05/08  09:48:34  davy
  168.    * Fix to avoid calling XFree with a null value.
  169.    * 
  170. ***************
  171. *** 19,22
  172.    * 
  173.    */
  174.   
  175. ! #define PatchLevel    1
  176.  
  177. --- 22,25 -----
  178.    * 
  179.    */
  180.   
  181. ! #define PatchLevel    2
  182. *** /tmp/,RCSt1a07683    Mon May  8 11:14:30 1989
  183. --- xcutbuf.c    Mon May  8 11:09:52 1989
  184. ***************
  185. *** 1,5
  186.   #ifndef lint
  187. ! static char *RCSid = "$Header: /usr/local/src/sun3/X.V11R3/contrib/clients/xcutbuf/RCS/xcutbuf.c,v 1.2 89/05/08 09:48:49 davy Exp $";
  188.   #endif
  189.   /*
  190.    * xcutbuf - X11 cut buffer manager
  191.  
  192. --- 1,5 -----
  193.   #ifndef lint
  194. ! static char *RCSid = "$Header: /usr/local/src/source/X.V11R3/contrib/clients/xcutbuf/RCS/xcutbuf.c,v 1.3 89/05/08 11:09:49 davy Exp $";
  195.   #endif
  196.   /*
  197.    * xcutbuf - X11 cut buffer manager
  198. ***************
  199. *** 23,28
  200.    * davy@riacs.edu
  201.    *
  202.    * $Log:    xcutbuf.c,v $
  203.    * Revision 1.2  89/05/08  09:48:49  davy
  204.    * Fix to avoid calling XFree with a null value.
  205.    * 
  206.  
  207. --- 23,31 -----
  208.    * davy@riacs.edu
  209.    *
  210.    * $Log:    xcutbuf.c,v $
  211. +  * Revision 1.3  89/05/08  11:09:49  davy
  212. +  * Fixed to properly handle buffer numbers after -list, -contents, -rotate.
  213. +  * 
  214.    * Revision 1.2  89/05/08  09:48:49  davy
  215.    * Fix to avoid calling XFree with a null value.
  216.    * 
  217. ***************
  218. *** 88,93
  219.                   usage();
  220.   
  221.               bnum = atoi(*++argv);
  222.               continue;
  223.           }
  224.   
  225.  
  226. --- 91,97 -----
  227.                   usage();
  228.   
  229.               bnum = atoi(*++argv);
  230. +             CheckBounds(bnum);
  231.               continue;
  232.           }
  233.   
  234. ***************
  235. *** 100,106
  236.                   usage();
  237.   
  238.               if (argc == 0) {
  239. !                 rotate = DEFAULT_ROTATE;
  240.               }
  241.               else {
  242.                   rotate = atoi(*++argv);
  243.  
  244. --- 104,110 -----
  245.                   usage();
  246.   
  247.               if (argc == 0) {
  248. !                 bnum = DEFAULT_ROTATE;
  249.               }
  250.               else {
  251.                   bnum = atoi(*++argv);
  252. ***************
  253. *** 103,110
  254.                   rotate = DEFAULT_ROTATE;
  255.               }
  256.               else {
  257. !                 rotate = atoi(*++argv);
  258. !                 CheckBounds(rotate);
  259.               }
  260.   
  261.               continue;
  262.  
  263. --- 107,114 -----
  264.                   bnum = DEFAULT_ROTATE;
  265.               }
  266.               else {
  267. !                 bnum = atoi(*++argv);
  268. !                 CheckBounds(bnum);
  269.               }
  270.   
  271.               rotate = 1;
  272. ***************
  273. *** 107,112
  274.                   CheckBounds(rotate);
  275.               }
  276.   
  277.               continue;
  278.           }
  279.   
  280.  
  281. --- 111,117 -----
  282.                   CheckBounds(bnum);
  283.               }
  284.   
  285. +             rotate = 1;
  286.               continue;
  287.           }
  288.   
  289. ***************
  290. *** 119,125
  291.                   usage();
  292.   
  293.               if (argc == 0) {
  294. !                 contents = DEFAULT_LIST;
  295.               }
  296.               else {
  297.                   contents = atoi(*++argv);
  298.  
  299. --- 124,130 -----
  300.                   usage();
  301.   
  302.               if (argc == 0) {
  303. !                 bnum = DEFAULT_LIST;
  304.               }
  305.               else {
  306.                   bnum = atoi(*++argv);
  307. ***************
  308. *** 122,129
  309.                   contents = DEFAULT_LIST;
  310.               }
  311.               else {
  312. !                 contents = atoi(*++argv);
  313. !                 CheckBounds(contents);
  314.               }
  315.   
  316.               continue;
  317.  
  318. --- 127,134 -----
  319.                   bnum = DEFAULT_LIST;
  320.               }
  321.               else {
  322. !                 bnum = atoi(*++argv);
  323. !                 CheckBounds(bnum);
  324.               }
  325.   
  326.               contents = 1;
  327. ***************
  328. *** 126,131
  329.                   CheckBounds(contents);
  330.               }
  331.   
  332.               continue;
  333.           }
  334.   
  335.  
  336. --- 131,137 -----
  337.                   CheckBounds(bnum);
  338.               }
  339.   
  340. +             contents = 1;
  341.               continue;
  342.           }
  343.   
  344. ***************
  345. *** 139,145
  346.                   usage();
  347.   
  348.               if (argc == 0) {
  349. !                 list = DEFAULT_LIST;
  350.               }
  351.               else {
  352.                   list = atoi(*++argv);
  353.  
  354. --- 145,151 -----
  355.                   usage();
  356.   
  357.               if (argc == 0) {
  358. !                 bnum = DEFAULT_LIST;
  359.               }
  360.               else {
  361.                   bnum = atoi(*++argv);
  362. ***************
  363. *** 142,149
  364.                   list = DEFAULT_LIST;
  365.               }
  366.               else {
  367. !                 list = atoi(*++argv);
  368. !                 CheckBounds(list);
  369.               }
  370.   
  371.               continue;
  372.  
  373. --- 148,155 -----
  374.                   bnum = DEFAULT_LIST;
  375.               }
  376.               else {
  377. !                 bnum = atoi(*++argv);
  378. !                 CheckBounds(bnum);
  379.               }
  380.   
  381.               list = 1;
  382. ***************
  383. *** 146,151
  384.                   CheckBounds(list);
  385.               }
  386.   
  387.               continue;
  388.           }
  389.   
  390.  
  391. --- 152,158 -----
  392.                   CheckBounds(bnum);
  393.               }
  394.   
  395. +             list = 1;
  396.               continue;
  397.           }
  398.   
  399. ***************
  400. *** 193,199
  401.        * Go do our thing.
  402.        */
  403.       if (contents)
  404. !         ListCutBuffers(display, contents, 1);
  405.       else if (list)
  406.           ListCutBuffers(display, list, 0);
  407.       else if (rotate)
  408.  
  409. --- 200,206 -----
  410.        * Go do our thing.
  411.        */
  412.       if (contents)
  413. !         ListCutBuffers(display, bnum, 1);
  414.       else if (list)
  415.           ListCutBuffers(display, bnum, 0);
  416.       else if (rotate)
  417. ***************
  418. *** 195,201
  419.       if (contents)
  420.           ListCutBuffers(display, contents, 1);
  421.       else if (list)
  422. !         ListCutBuffers(display, list, 0);
  423.       else if (rotate)
  424.           RotateCutBuffers(display, rotate);
  425.       else if (stuff)
  426.  
  427. --- 202,208 -----
  428.       if (contents)
  429.           ListCutBuffers(display, bnum, 1);
  430.       else if (list)
  431. !         ListCutBuffers(display, bnum, 0);
  432.       else if (rotate)
  433.           RotateCutBuffers(display, bnum);
  434.       else if (stuff)
  435. ***************
  436. *** 197,203
  437.       else if (list)
  438.           ListCutBuffers(display, list, 0);
  439.       else if (rotate)
  440. !         RotateCutBuffers(display, rotate);
  441.       else if (stuff)
  442.           StuffCutBuffers(display, filename, bnum, argc, argv);
  443.   
  444.  
  445. --- 204,210 -----
  446.       else if (list)
  447.           ListCutBuffers(display, bnum, 0);
  448.       else if (rotate)
  449. !         RotateCutBuffers(display, bnum);
  450.       else if (stuff)
  451.           StuffCutBuffers(display, filename, bnum, argc, argv);
  452.   
  453.