home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume4 / xgone / patch1 next >
Internet Message Format  |  1989-06-03  |  3KB

  1. Path: uunet!island!argv
  2. From: argv@island.uu.net (Dan Heller)
  3. Newsgroups: comp.sources.x
  4. Subject: v04i016:  xgone, Patch1
  5. Message-ID: <788@island.uu.net>
  6. Date: 3 Jun 89 21:59:48 GMT
  7. Organization: Island Graphics, Marin County, California
  8. Lines: 72
  9. Approved: island!argv@sun.com
  10.  
  11. Submitted-by: Richard Johnson <raj%tertius.ics.uci.edu@PARIS.ICS.UCI.EDU>
  12. Posting-number: Volume 4, Issue 16
  13. Archive-name: xgone/patch1
  14.  
  15. [ The patch that Richard sent me didn't quite apply to the version that
  16.   was originally posted, so I modified it somewhat so that it would.
  17.   The patch fixes a problem where the program would dump if you typed
  18.   too many characters at the password prompt.  --argv ]
  19.  
  20. *** patchlevel.h.orig    Sat Jun  3 14:49:59 1989
  21. --- patchlevel.h    Sat Jun  3 14:50:05 1989
  22. ***************
  23. *** 1 ****
  24. ! #define PATCHLEVEL 0
  25. --- 1 ----
  26. ! #define PATCHLEVEL 1
  27. *** xgone.c.orig    Sat Jun  3 14:41:13 1989
  28. --- xgone.c    Sat Jun  3 14:51:38 1989
  29. ***************
  30. *** 20,25 ****
  31. --- 20,26 ----
  32.   #define FALSE        0
  33.   #define TRUE        1
  34.   #define UTMP        "/etc/utmp"    /* the utmp file */
  35. + #define RESPBUFSIZ    100        /* size of response from user */
  36.   #define control(a)    ((a) - ('@'))    /* control characters */
  37.   
  38.   char    DspMsg[1024]="X Gone";    /* Default message to display */
  39. ***************
  40. *** 51,58 ****
  41.       XColor            whitecolor;
  42.       Pixmap            pixmap;
  43.       Cursor            cursor;
  44. !     char            buffer[100], inputbuf[80], *string, *user_name
  45. !                 ,*getenv(), *ctime(), *rindex(), response[100];
  46.       char            *crypt(), *pw, root_pw[20], *user_passwd;
  47.       int                len, password_bad = 1, response_i, nbytes, i;
  48.       struct passwd        *u;
  49. --- 52,60 ----
  50.       XColor            whitecolor;
  51.       Pixmap            pixmap;
  52.       Cursor            cursor;
  53. !     char            buffer[100], inputbuf[80], *string, *user_name,
  54. !                 *getenv(), *ctime(), *rindex(),
  55. !                 response[RESPBUFSIZ];
  56.       char            *crypt(), *pw, root_pw[20], *user_passwd;
  57.       int                len, password_bad = 1, response_i, nbytes, i;
  58.       struct passwd        *u;
  59. ***************
  60. *** 284,293 ****
  61.               response_i--;    /* delete */
  62.               else if(inputbuf[i] == control('U'))
  63.               response_i = 1;    /* reset to first char */
  64. !             else {
  65.               response[response_i] = inputbuf[i++];
  66.               if(response[response_i++] == '\r') break;
  67. !             }
  68.           }
  69.           }
  70.           if(response[response_i - 1] == '\r') break;    /* finished */
  71. --- 286,296 ----
  72.               response_i--;    /* delete */
  73.               else if(inputbuf[i] == control('U'))
  74.               response_i = 1;    /* reset to first char */
  75. !             else if(response_i < RESPBUFSIZ) {
  76.               response[response_i] = inputbuf[i++];
  77.               if(response[response_i++] == '\r') break;
  78. !             } else    /* too many char's */
  79. !             XBell(dpy, 100 /* % */);
  80.           }
  81.           }
  82.           if(response[response_i - 1] == '\r') break;    /* finished */
  83.