]> git.pld-linux.org Git - packages/seyon.git/blob - seyon-debian.patch
- commented out non-existent patch
[packages/seyon.git] / seyon-debian.patch
1 --- seyon-2.20c.orig/Seyon.ad
2 +++ seyon-2.20c/Seyon.ad
3 @@ -259,31 +261,6 @@
4  *statusBox.rng.label: RNG
5  
6  !
7 -! Quick Keys
8 -!
9 -
10 -*quickKeyBox.Command.font: 6x10
11 -
12 -*quickKey1.visible: on
13 -*quickKey2.visible: on
14 -*quickKey3.visible: on
15 -*quickKey4.visible: on
16 -*quickKey5.visible: on
17 -
18 -!*quickKey1.action: DialEntries(1);
19 -!*quickKey2.action: DialEntries(3);
20 -!*quickKey3.action: FileTransfer(2, ou*);
21 -!*quickKey4.action: DivertFile(/tmp/lo);
22 -!*quickKey5.action: Hangup(); Beep(); 
23 -!RunScript(test1); Echo(ll);
24 -
25 -*quickKey1.label: Athena
26 -*quickKey2.label: Ch1
27 -*quickKey3.label: UpMail
28 -*quickKey4.label: DivMsg
29 -*quickKey5.label: Local
30 -
31 -!
32  ! Fun messages. Send me more please.
33  !
34  
35 @@ -302,6 +279,7 @@
36         "Have something funny? send it!" \
37         "I've fallen and I can't get up!"
38  
39 ++*showFunMessages: off
40  *notImplemented*title: Seyon Feature
41  *notImplemented.dialog.label: \
42  This feature is not yet implemented\n\
43 --- seyon-2.20c.orig/1-CHANGES
44 +++ seyon-2.20c/1-CHANGES
45 @@ -12,7 +12,6 @@
46  Rolled in some obvious bug fixes from the Debian version of 2.14c:
47      * Fixed typo in Seyon.ad: s/replcae/replace
48      * Added #include <linux/serial.h> to SePort.c for Linux
49 -    * Minor changes to ExecShellCommand; used to crash, should no more.
50      * Now under GPL (see 1-COPYING for details), new maintainer.
51  
52  Versions up to 2.20b:
53 --- seyon-2.20c.orig/SeTerm.c
54 +++ seyon-2.20c/SeTerm.c
55 @@ -10,7 +10,7 @@
56   * This file contains routines for Seyon's terminal. The main routine is
57   * terminal(), which reads characters from the terminal and sends them to the
58   * port. That routine also forks a child process that reads characters from
59 - * the port and writes them to the temrinal. Once the parent receives SIGTERM
60 + * the port and writes them to the terminal. Once the parent receives SIGTERM
61   * (which should be sent by the grand parent), it kills the child and exits.
62   */
63  
64 --- seyon-2.20c.orig/MultiList.c
65 +++ seyon-2.20c/MultiList.c
66 @@ -1031,8 +1031,8 @@
67  XfwfMultiListWidget mlw;
68  int row,column;
69  {
70 -       GC bg_gc,fg_gc;
71 -       XfwfMultiListItem *item;
72 +       GC bg_gc,fg_gc = 0;
73 +       XfwfMultiListItem *item = NULL;
74         int ul_x,ul_y,str_x,str_y,w,h,item_index,has_item,text_h;
75  
76         if (!XtIsRealized((Widget)mlw)) return;
77 --- seyon-2.20c.orig/SeInit.c
78 +++ seyon-2.20c/SeInit.c
79 @@ -34,30 +34,30 @@
80  #endif
81  
82  extern void     TopAbout(),
83 -                TopHelp(),
84 -                TopSet(),
85 -                TopTransfer(),
86 -                TopMisc(),
87 -                SetNewlineTrMode(),
88 -                FunMessage();
89 +    TopHelp(),
90 +    TopSet(),
91 +    TopTransfer(),
92 +    TopMisc(),
93 +    SetNewlineTrMode(),
94 +    FunMessage();
95  
96  extern void     upload_acc_ok(),
97 -                setVal_action_ok(),
98 -                manual_dial_action_ok(),
99 -                divert_action_ok();
100 +    setVal_action_ok(),
101 +    manual_dial_action_ok(),
102 +    divert_action_ok();
103  
104  extern Boolean  CvtStringToStringArray();
105  
106  void            HangupConfirm(),
107 -                ExecHangup(),
108 -                ExitConfirm(),
109 -                ExitAction(),
110 -                test();
111 +    ExecHangup(),
112 +    ExitConfirm(),
113 +    ExitAction(),
114 +    test();
115  
116  Boolean         inhibit_child = False;
117  Widget          w_exit,
118 -                w_kill,
119 -                statusMessage;
120 +    w_kill,
121 +    statusMessage;
122  Widget          dialWidget, genericWidget;
123  pid_t           w_child_pid = 0;
124  Pixmap          progIcon;
125 @@ -66,194 +66,202 @@
126  
127  void
128  InitVariables(topLevel)
129 -     Widget          topLevel;
130 +    Widget          topLevel;
131  {
132 -  char            buffer[REG_BUF];
133 +    char            buffer[REG_BUF];
134  
135 -  sprintf(captureFile, "%s/%s", expand_fname(qres.defaultDirectory, buffer),
136 -         qres.captureFile);
137 +    expand_fname(qres.defaultDirectory, buffer, REG_BUF);
138  
139 -  SetNewlineTrMode(qres.newlineTranslation);
140 +    if(REG_BUF > (1 + strlen(buffer) + strlen(qres.captureFile)))
141 +        sprintf(captureFile, "%s/%s", buffer, qres.captureFile);
142 +    else
143 +    {
144 +        printf("Buffer overflow in InitVariables: %s/%s\nExit\n",buffer, qres.captureFile);
145 +        exit(1);
146 +    }
147 +    
148 +    SetNewlineTrMode(qres.newlineTranslation);
149  }
150  
151  void
152  SetIcon(topLevelWidget)
153 -     Widget          topLevelWidget;
154 +    Widget          topLevelWidget;
155  {
156 -  progIcon = 
157 -       XCreateBitmapFromData(XtDisplay(topLevelWidget),
158 -                                                 DefaultRootWindow(XtDisplay(topLevelWidget)),
159 -                                                 progIcon_bits, progIcon_width,
160 -                                                 progIcon_height);
161 -  XtVaSetValues(topLevelWidget, XtNiconPixmap, progIcon, NULL);
162 +    progIcon = 
163 +        XCreateBitmapFromData(XtDisplay(topLevelWidget),
164 +                       DefaultRootWindow(XtDisplay(topLevelWidget)),
165 +                       progIcon_bits, progIcon_width,
166 +                       progIcon_height);
167 +    XtVaSetValues(topLevelWidget, XtNiconPixmap, progIcon, NULL);
168  }
169  
170  void
171  CreateCommandCenter()
172  {
173 -  void            GetQuickKeyResources(),
174 -                  GetValueByPopupOKAction(),
175 -                  DispatchActionsCallback();
176 -  void            TopShell();
177 -  void            KillChildProc();
178 -
179 -  Widget          mainBox,
180 -                  menuBox,
181 -                  statusBox,
182 -                  messageBox,
183 -                  quickKeyBox;
184 -  static Widget   status[NUM_MDM_STAT];
185 -  static Atom     wm_delete_window;
186 -  Dimension       menuBoxWidth;
187 -
188 -  struct _quickKeyRes quickKeyRes;
189 -  Widget          quickKeyW;
190 -  char            qKBuf[REG_BUF];
191 -  int             i, n = 0;
192 -
193 -  static XtActionsRec actionTable[] = {
194 -    {"UploadOk", upload_acc_ok},
195 -    {"SetValOk", setVal_action_ok},
196 -    {"ManualDialOk", manual_dial_action_ok},
197 -    {"DivertOk", divert_action_ok},
198 -    {"Exit", ExitAction},
199 -    {"GetValueByPopupOK", GetValueByPopupOKAction},
200 -  };
201 -
202 -  XtAppAddActions(XtWidgetToApplicationContext(topLevel), actionTable, 
203 -                                 XtNumber(actionTable));
204 -
205 -  mainBox = SeAddPaned("mainBox", topLevel);
206 -  statusBox = AddBox("statusBox", mainBox);
207 -  messageBox = SeAddForm("messageBox", mainBox);
208 -  quickKeyBox = AddBox("quickKeyBox", mainBox);
209 -  menuBox = AddBox("menuBox", mainBox);
210 -
211 -  status[0] = SeAddToggle("dcd", statusBox, NULL);
212 -  status[1] = SeAddToggle("dtr", statusBox, NULL);
213 -  status[2] = SeAddToggle("dsr", statusBox, NULL);
214 -  status[3] = SeAddToggle("rts", statusBox, NULL);
215 -  status[4] = SeAddToggle("cts", statusBox, NULL);
216 -  status[5] = SeAddToggle("rng", statusBox, NULL);
217 -
218 -  statusMessage = SeAddLabel("message", messageBox);
219 -
220 -  AddButton("about", menuBox, TopAbout, NULL);
221 -  AddButton("help", menuBox, TopHelp, NULL);
222 -  AddButton("set", menuBox, TopSet, NULL);
223 -  genericWidget = dialWidget = AddButton("dial", menuBox, TopDial, NULL);
224 -  AddButton("transfer", menuBox, TopTransfer, NULL);
225 -  AddButton("shellCommand", menuBox, TopShell, NULL);
226 -  AddButton("misc", menuBox, TopMisc, NULL);
227 -  AddButton("hangup", menuBox, HangupConfirm, NULL);
228 -  w_exit = AddButton("exit", menuBox, ExitConfirm, NULL);
229 -  w_kill = AddButton("kill", menuBox, KillChildProc, NULL);
230 -
231 -  for (i = 0; i < MAX_SEQUICKKEYS; i++) {
232 -       sprintf(qKBuf, "quickKey%d", i+1);
233 -       GetQuickKeyResources(qKBuf, &quickKeyRes);
234 -       if (quickKeyRes.visible) {
235 -      n++;
236 +    void            GetQuickKeyResources(),
237 +        GetValueByPopupOKAction(),
238 +        DispatchActionsCallback();
239 +    void            TopShell();
240 +    void            KillChildProc();
241 +
242 +    Widget          mainBox,
243 +        menuBox,
244 +        statusBox,
245 +        messageBox,
246 +        quickKeyBox;
247 +    static Widget   status[NUM_MDM_STAT];
248 +    static Atom     wm_delete_window;
249 +    Dimension       menuBoxWidth;
250 +
251 +    struct _quickKeyRes quickKeyRes;
252 +    Widget          quickKeyW;
253 +    char            qKBuf[LRG_BUF];
254 +    int             i, n = 0;
255 +
256 +    static XtActionsRec actionTable[] = {
257 +        {"UploadOk", upload_acc_ok},
258 +        {"SetValOk", setVal_action_ok},
259 +        {"ManualDialOk", manual_dial_action_ok},
260 +        {"DivertOk", divert_action_ok},
261 +        {"Exit", ExitAction},
262 +        {"GetValueByPopupOK", GetValueByPopupOKAction},
263 +    };
264 +
265 +    XtAppAddActions(XtWidgetToApplicationContext(topLevel), actionTable, 
266 +               XtNumber(actionTable));
267 +
268 +    mainBox = SeAddPaned("mainBox", topLevel);
269 +    statusBox = AddBox("statusBox", mainBox);
270 +    messageBox = SeAddForm("messageBox", mainBox);
271 +    quickKeyBox = AddBox("quickKeyBox", mainBox);
272 +    menuBox = AddBox("menuBox", mainBox);
273 +
274 +    status[0] = SeAddToggle("dcd", statusBox, NULL);
275 +    status[1] = SeAddToggle("dtr", statusBox, NULL);
276 +    status[2] = SeAddToggle("dsr", statusBox, NULL);
277 +    status[3] = SeAddToggle("rts", statusBox, NULL);
278 +    status[4] = SeAddToggle("cts", statusBox, NULL);
279 +    status[5] = SeAddToggle("rng", statusBox, NULL);
280 +
281 +    statusMessage = SeAddLabel("message", messageBox);
282 +
283 +    AddButton("about", menuBox, TopAbout, NULL);
284 +    AddButton("help", menuBox, TopHelp, NULL);
285 +    AddButton("set", menuBox, TopSet, NULL);
286 +    genericWidget = dialWidget = AddButton("dial", menuBox, TopDial, NULL);
287 +    AddButton("transfer", menuBox, TopTransfer, NULL);
288 +    AddButton("shellCommand", menuBox, TopShell, NULL);
289 +    AddButton("misc", menuBox, TopMisc, NULL);
290 +    AddButton("hangup", menuBox, HangupConfirm, NULL);
291 +    w_exit = AddButton("exit", menuBox, ExitConfirm, NULL);
292 +    w_kill = AddButton("kill", menuBox, KillChildProc, NULL);
293 +
294 +    for (i = 0; i < MAX_SEQUICKKEYS; i++) {
295 +        sprintf(qKBuf, "quickKey%d", i+1); /* qKBuf is large enough here... */
296 +        GetQuickKeyResources(qKBuf, &quickKeyRes);
297 +        if (quickKeyRes.visible) {
298 +         n++;
299           quickKeyW = 
300 -               AddButton(qKBuf, quickKeyBox, DispatchActionsCallback, NULL);
301 -       }
302 -  }
303 -  if (n == 0) XtDestroyWidget(quickKeyBox);
304 -
305 -  XtOverrideTranslations(topLevel,
306 -                           XtParseTranslationTable("<Message>WM_PROTOCOLS: Exit()"));
307 -
308 -  /* Call UpdateStatusBox() before realizing the top-level widget so that
309 -        the status widget array in that function would be properly initialized
310 -        before the user is able to call hangup(), since the latter passes NULL
311 -        to UpdateStatusBox() */
312 -  UpdateStatusBox((XtPointer)status);
313 -
314 -  XtSetMappedWhenManaged(topLevel, False);
315 -  XtRealizeWidget(topLevel);
316 -  XtVaGetValues(menuBox, XtNwidth, &menuBoxWidth, NULL);
317 -  XtVaSetValues(statusBox, XtNwidth, menuBoxWidth, NULL);
318 -  if (n) XtVaSetValues(quickKeyBox, XtNwidth, menuBoxWidth, NULL);
319 -
320 -  /*
321 -   * (ideally one should not assume any fixed numbers, but this will do 
322 -   * for now).
323 -   *
324 -   * width of message box = label width
325 -   *                      + 2*border width (2*1)
326 -   *                      + defaultDistance (right) (1)
327 -   *                      + horizDistance (left) (4)
328 -   *
329 -   * desired width of label = width of menu box
330 -   *                        - hSpace of menu box (2*4) (to align with buttons)
331 -   *                        - border with of label (2*1)
332 -   *                        = width of menu box - 10
333 -   *
334 -   * => width of message box = width of menu box - 10 + 7
335 -   * => width of message box < width of menu box
336 -   * => menu box width is the controlling factor in deciding the widnow
337 -   *    width, as desired.
338 -   */
339 -  XtVaSetValues(statusMessage, XtNresizable, True, NULL);
340 -  XtVaSetValues(statusMessage, XtNwidth, menuBoxWidth - 10, NULL);
341 -  XtVaSetValues(statusMessage, XtNresizable, False, NULL);
342 -
343 -  wm_delete_window = XInternAtom(XtDisplay(topLevel), 
344 -                                                                "WM_DELETE_WINDOW", False);
345 -  XSetWMProtocols(XtDisplay(topLevel), XtWindow(topLevel), 
346 -                                 &wm_delete_window, 1);
347 +             AddButton(qKBuf, quickKeyBox, DispatchActionsCallback, NULL);
348 +        }
349 +    }
350 +    if (n == 0) XtDestroyWidget(quickKeyBox);
351 +
352 +    XtOverrideTranslations(topLevel,
353 +                      XtParseTranslationTable("<Message>WM_PROTOCOLS: Exit()"));
354 +
355 +    /* Call UpdateStatusBox() before realizing the top-level widget so that
356 +       the status widget array in that function would be properly initialized
357 +       before the user is able to call hangup(), since the latter passes NULL
358 +       to UpdateStatusBox() */
359 +    UpdateStatusBox((XtPointer)status);
360 +
361 +    XtSetMappedWhenManaged(topLevel, False);
362 +    XtRealizeWidget(topLevel);
363 +    XtVaGetValues(menuBox, XtNwidth, &menuBoxWidth, NULL);
364 +    XtVaSetValues(statusBox, XtNwidth, menuBoxWidth, NULL);
365 +    if (n) XtVaSetValues(quickKeyBox, XtNwidth, menuBoxWidth, NULL);
366 +
367 +    /*
368 +     * (ideally one should not assume any fixed numbers, but this will do 
369 +     * for now).
370 +     *
371 +     * width of message box = label width
372 +     *                      + 2*border width (2*1)
373 +     *                      + defaultDistance (right) (1)
374 +     *                      + horizDistance (left) (4)
375 +     *
376 +     * desired width of label = width of menu box
377 +     *                        - hSpace of menu box (2*4) (to align with buttons)
378 +     *                        - border with of label (2*1)
379 +     *                        = width of menu box - 10
380 +     *
381 +     * => width of message box = width of menu box - 10 + 7
382 +     * => width of message box < width of menu box
383 +     * => menu box width is the controlling factor in deciding the widnow
384 +     *    width, as desired.
385 +     */
386 +    XtVaSetValues(statusMessage, XtNresizable, True, NULL);
387 +    XtVaSetValues(statusMessage, XtNwidth, menuBoxWidth - 10, NULL);
388 +    XtVaSetValues(statusMessage, XtNresizable, False, NULL);
389 +
390 +    wm_delete_window = XInternAtom(XtDisplay(topLevel), 
391 +                            "WM_DELETE_WINDOW", False);
392 +    XSetWMProtocols(XtDisplay(topLevel), XtWindow(topLevel), 
393 +               &wm_delete_window, 1);
394  }
395  
396  void
397  TopAbout(parent)
398 -     Widget          parent;
399 +    Widget          parent;
400  {
401 -  Widget          popup,
402 -                  mBox,
403 -                  uBox,
404 -                  lBox,
405 -                  pic,
406 -                  msg,
407 -                  caption;
408 -  Pixmap          pix;
409 -  Dimension       width1,
410 -                  width2;
411 -  char            msgStr[LRG_BUF];
412 +    Widget          popup,
413 +        mBox,
414 +        uBox,
415 +        lBox,
416 +        pic,
417 +        msg,
418 +        caption;
419 +    Pixmap          pix;
420 +    Dimension       width1,
421 +        width2;
422 +    char            msgStr[LRG_BUF];
423  #include "authPic.h"
424  
425 -  popup = SeAddPopup("about", parent);
426 -  mBox = SeAddPaned("mBox", popup);
427 -  uBox = SeAddBox("uBox", mBox);
428 -  lBox = SeAddBox("lBox", mBox);
429 -
430 -  msg = SeAddLabel("msg", uBox);
431 -  pic = SeAddLabel("pic", uBox);
432 -  caption = SeAddLabel("caption", uBox);
433 +    popup = SeAddPopup("about", parent);
434 +    mBox = SeAddPaned("mBox", popup);
435 +    uBox = SeAddBox("uBox", mBox);
436 +    lBox = SeAddBox("lBox", mBox);
437 +
438 +    msg = SeAddLabel("msg", uBox);
439 +    pic = SeAddLabel("pic", uBox);
440 +    caption = SeAddLabel("caption", uBox);
441  
442 -  sprintf(msgStr, "%s %s rev. %s\n%s\n%s\n%s", "Seyon version", VERSION,
443 +    /* msgStr is big enough here */
444 +    sprintf(msgStr, "%s %s rev. %s\n%s\n%s\n%s", "Seyon version", VERSION,
445           REVISION, "Copyright 1992-1993", "(c) Muhammad M. Saggaf",
446           "All rights reserved");
447 -  XtVaSetValues(msg, XtNlabel, msgStr, NULL);
448 +    XtVaSetValues(msg, XtNlabel, msgStr, NULL);
449  
450 -  pix = XCreateBitmapFromData(XtDisplay(pic),
451 -                             DefaultRootWindow(XtDisplay(pic)),
452 -                             authPic_bits, authPic_width,
453 -                             authPic_height);
454 -  XtVaSetValues(pic, XtNbitmap, pix, NULL);
455 -
456 -  width1 = SeWidgetWidth(msg);
457 -  width2 = SeWidgetWidth(pic);
458 -  width1 = width1 > width2 ? width1 : width2;
459 -  width2 = SeWidgetWidth(caption);
460 -  width1 = width1 > width2 ? width1 : width2;
461 -
462 -  XtVaSetValues(msg, XtNwidth, width1, NULL);
463 -  XtVaSetValues(pic, XtNwidth, width1, NULL);
464 -  XtVaSetValues(caption, XtNwidth, width1, NULL);
465 +    pix = XCreateBitmapFromData(XtDisplay(pic),
466 +                         DefaultRootWindow(XtDisplay(pic)),
467 +                         authPic_bits, authPic_width,
468 +                         authPic_height);
469 +    XtVaSetValues(pic, XtNbitmap, pix, NULL);
470 +
471 +    width1 = SeWidgetWidth(msg);
472 +    width2 = SeWidgetWidth(pic);
473 +    width1 = width1 > width2 ? width1 : width2;
474 +    width2 = SeWidgetWidth(caption);
475 +    width1 = width1 > width2 ? width1 : width2;
476 +
477 +    XtVaSetValues(msg, XtNwidth, width1, NULL);
478 +    XtVaSetValues(pic, XtNwidth, width1, NULL);
479 +    XtVaSetValues(caption, XtNwidth, width1, NULL);
480  
481 -  SeAddButton("dismiss", lBox, DestroyShell);
482 +    SeAddButton("dismiss", lBox, DestroyShell);
483  
484 -  XtPopupSpringLoaded(popup);
485 +    XtPopupSpringLoaded(popup);
486  }
487  
488  /*
489 @@ -262,151 +270,151 @@
490  
491  void
492  TopHelp(widget)
493 -     Widget          widget;
494 +    Widget          widget;
495  {
496 -  Widget          DoDisplayFile();
497 -  Widget          displayPopup;
498 +    Widget          DoDisplayFile();
499 +    Widget          displayPopup;
500  
501 -  XtVaSetValues(widget, XtNsensitive, False, NULL);
502 -  displayPopup = DoDisplayFile(widget, qres.helpFile);
503 -  XtAddCallback(displayPopup, XtNdestroyCallback, SetSensitiveOn, widget);
504 +    XtVaSetValues(widget, XtNsensitive, False, NULL);
505 +    displayPopup = DoDisplayFile(widget, qres.helpFile);
506 +    XtAddCallback(displayPopup, XtNdestroyCallback, SetSensitiveOn, widget);
507  
508 -  PositionShell(displayPopup, widget, SHELLPOS_HWFH);
509 -  XtPopup(displayPopup, XtGrabNone);
510 +    PositionShell(displayPopup, widget, SHELLPOS_HWFH);
511 +    XtPopup(displayPopup, XtGrabNone);
512  }
513  
514  void
515  ExecHangup()
516  {
517 -  MdmHangup();
518 -  SeyonMessage("Line Disconnected");
519 +    MdmHangup();
520 +    SeyonMessage("Line Disconnected");
521  }
522  
523  void
524  DoHangup(widget)
525 -     Widget          widget;
526 +    Widget          widget;
527  {
528 -  DestroyShell(widget);
529 -  ExecHangup();
530 +    DestroyShell(widget);
531 +    ExecHangup();
532  }
533  
534  void
535  HangupConfirm(widget)
536 -     Widget          widget;
537 +    Widget          widget;
538  {
539 -  Widget          popup,
540 -                  dialog;
541 +    Widget          popup,
542 +        dialog;
543  
544 -  ErrorIfBusy()
545 +    ErrorIfBusy()
546  
547 -  if (qres.hangupConfirm) {
548 -       popup = AddSimplePopup("hangup", widget);
549 -       dialog = SeAddDialog("dialog", popup);
550 +        if (qres.hangupConfirm) {
551 +         popup = AddSimplePopup("hangup", widget);
552 +         dialog = SeAddDialog("dialog", popup);
553         
554 -       XawDialogAddButton(dialog, "yes", DoHangup, (XtPointer) dialog);
555 -       XawDialogAddButton(dialog, "cancel", DestroyShell, NULL);
556 +         XawDialogAddButton(dialog, "yes", DoHangup, (XtPointer) dialog);
557 +         XawDialogAddButton(dialog, "cancel", DestroyShell, NULL);
558         
559 -       PopupCentered(popup, widget);
560 -  }
561 -  else
562 -       ExecHangup();
563 +         PopupCentered(popup, widget);
564 +        }
565 +        else
566 +         ExecHangup();
567  }
568  
569  void
570  ExitNoHangup(widget)
571 -     Widget          widget;
572 +    Widget          widget;
573  {
574 -  DestroyShell(widget);
575 -  s_exit(widget);
576 +    DestroyShell(widget);
577 +    s_exit(widget);
578  }
579  
580  void
581  ExitHangup(widget)
582 -     Widget          widget;
583 +    Widget          widget;
584  {
585 -  ExecHangup();
586 -  ExitNoHangup(widget);
587 +    ExecHangup();
588 +    ExitNoHangup(widget);
589  }
590  
591  void
592  ExitConfirm(widget)
593 -     Widget          widget;
594 +    Widget          widget;
595  {
596 -  Widget          popup,
597 -                  dialog;
598 +    Widget          popup,
599 +        dialog;
600  
601 -  if (qres.exitConfirm && !qres.ignoreModemDCD && Online()) {
602 -       popup = AddSimplePopup("exit", widget);
603 -       dialog = SeAddDialog("dialog", popup);
604 +    if (qres.exitConfirm && !qres.ignoreModemDCD && Online()) {
605 +        popup = AddSimplePopup("exit", widget);
606 +        dialog = SeAddDialog("dialog", popup);
607         
608 -       XawDialogAddButton(dialog, "yes", ExitHangup, NULL);
609 -       XawDialogAddButton(dialog, "no", ExitNoHangup, NULL);
610 -       XawDialogAddButton(dialog, "cancel", DestroyShell, NULL);
611 +        XawDialogAddButton(dialog, "yes", ExitHangup, NULL);
612 +        XawDialogAddButton(dialog, "no", ExitNoHangup, NULL);
613 +        XawDialogAddButton(dialog, "cancel", DestroyShell, NULL);
614         
615 -       PopupCentered(popup, widget);
616 -  }
617 -  else
618 -       s_exit();
619 +        PopupCentered(popup, widget);
620 +    }
621 +    else
622 +        s_exit();
623  }
624  
625  void
626  ExitAction(widget)
627 -     Widget          widget;
628 +    Widget          widget;
629  {
630 -  Boolean         wExitButtonStatus;
631 +    Boolean         wExitButtonStatus;
632  
633 -  /* Prevent the user from exiting the program by f.delete if exiting
634 -        is not permitted */
635 -  XtVaGetValues(w_exit, XtNsensitive, &wExitButtonStatus, NULL);
636 -  ReturnIfTrue(!wExitButtonStatus);
637 -  s_exit();
638 +    /* Prevent the user from exiting the program by f.delete if exiting
639 +       is not permitted */
640 +    XtVaGetValues(w_exit, XtNsensitive, &wExitButtonStatus, NULL);
641 +    ReturnIfTrue(!wExitButtonStatus);
642 +    s_exit();
643  }
644  
645  void
646  w_exit_up(w_exit_status)
647 -     Boolean         w_exit_status;
648 +    Boolean         w_exit_status;
649  {
650 -  XtVaSetValues(w_exit, XtNsensitive, w_exit_status, NULL);
651 +    XtVaSetValues(w_exit, XtNsensitive, w_exit_status, NULL);
652  }
653  
654  void
655  SetKillButtonSens(killWidgetStatus)
656 -     Boolean         killWidgetStatus;
657 +    Boolean         killWidgetStatus;
658  {
659 -  XtVaSetValues(w_kill, XtNsensitive, killWidgetStatus, NULL);
660 -  w_exit_up(!killWidgetStatus);
661 +    XtVaSetValues(w_kill, XtNsensitive, killWidgetStatus, NULL);
662 +    w_exit_up(!killWidgetStatus);
663  }
664  
665  void
666  w_kill_up(w_kill_status)
667 -     Boolean         w_kill_status;
668 +    Boolean         w_kill_status;
669  {
670 -  SetKillButtonSens(w_kill_status);
671 +    SetKillButtonSens(w_kill_status);
672  }
673  
674  void
675  KillChildProc()
676  {
677 -  if (w_child_pid == 0) return;
678 -  if (kill(w_child_pid, SIGTERM) == 0) w_child_pid = 0;
679 +    if (w_child_pid == 0) return;
680 +    if (kill(w_child_pid, SIGTERM) == 0) w_child_pid = 0;
681  }
682  
683  void
684  GetQuickKeyResources(quickKeyName, quickKeyRes)
685 -        String               quickKeyName;
686 -        struct _quickKeyRes *quickKeyRes;
687 +    String               quickKeyName;
688 +    struct _quickKeyRes *quickKeyRes;
689  {
690  #define offset(field) XtOffsetOf(struct _quickKeyRes, field)
691 -  static XtResource resources[] = {
692 -    {"visible", "Visible", XtRBoolean, sizeof(Boolean),
693 -          offset(visible), XtRImmediate, (XtPointer)False},
694 -    {"action", "Action", XtRString, sizeof(String),
695 -          offset(action), XtRString, (XtPointer)""},
696 -  };
697 +    static XtResource resources[] = {
698 +        {"visible", "Visible", XtRBoolean, sizeof(Boolean),
699 +         offset(visible), XtRImmediate, (XtPointer)False},
700 +        {"action", "Action", XtRString, sizeof(String),
701 +         offset(action), XtRString, (XtPointer)""},
702 +    };
703  #undef offset
704    
705 -  XtGetSubresources(topLevel, (XtPointer)quickKeyRes, quickKeyName, "Command",
706 -                                       resources, XtNumber(resources), NULL, 0);
707 +    XtGetSubresources(topLevel, (XtPointer)quickKeyRes, quickKeyName, "Command",
708 +                 resources, XtNumber(resources), NULL, 0);
709  }
710  
711  void
712 @@ -414,140 +422,140 @@
713  {
714  #define offset(field) XtOffsetOf(struct QueryResources, field)
715  
716 -  static XtResource resources[] = {
717 -    {"modems", "Modems", XtRString, sizeof(String),
718 -          offset(modems), XtRString, (XtPointer)""},
719 -    {"script", "Script", XtRString, sizeof(String),
720 -          offset(script), XtRString, (XtPointer) NULL},
721 +    static XtResource resources[] = {
722 +        {"modems", "Modems", XtRString, sizeof(String),
723 +         offset(modems), XtRString, (XtPointer)""},
724 +        {"script", "Script", XtRString, sizeof(String),
725 +         offset(script), XtRString, (XtPointer) NULL},
726         
727 -    {"defaultBPS", "DefaultBPS", XtRString, sizeof(String),
728 -          offset(defaultBPS), XtRString, (XtPointer) "9600"},
729 -    {"defaultBits", "DefaultBits", XtRInt, sizeof(int),
730 -          offset(defaultBits), XtRImmediate, (XtPointer) 8},
731 -    {"defaultParity", "DefaultParity", XtRInt, sizeof(int),
732 -          offset(defaultParity), XtRImmediate, (XtPointer) 0},
733 -    {"defaultStopBits", "DefaultStopBits", XtRInt, sizeof(int),
734 -          offset(defaultStopBits), XtRImmediate, (XtPointer) 1},
735 -    {"stripHighBit", "StripHighBit", XtRBoolean, sizeof(Boolean),
736 -          offset(stripHighBit), XtRImmediate, (XtPointer) False},
737 -    {"backspaceTranslation", "BackspaceTranslation", XtRBoolean,
738 -          sizeof(Boolean), offset(backspaceTranslation), XtRImmediate,
739 -          (XtPointer) False},
740 -    {"metaKeyTranslation", "MetaKeyTranslation", XtRBoolean,
741 -          sizeof(Boolean), offset(metaKeyTranslation), XtRImmediate,
742 -          (XtPointer) True},
743 -    {"xonxoffFlowControl", "XonxoffFlowControl", XtRBoolean,
744 -          sizeof(Boolean), offset(xonxoffFlowControl), XtRImmediate,
745 -          (XtPointer) False},
746 -    {"rtsctsFlowControl", "RtsctsFlowControl", XtRBoolean,
747 -          sizeof(Boolean), offset(rtsctsFlowControl), XtRImmediate,
748 -          (XtPointer) False},
749 -    {"newlineTranslation", "NewlineTranslation", XtRString,
750 -          sizeof(String), offset(newlineTranslation), XtRImmediate,
751 -          (XtPointer) "cr"},
752 -
753 -    {"dialPrefix", "DialPrefix", XtRString, sizeof(String),
754 -          offset(dialPrefix), XtRString, (XtPointer) "ATDT"},
755 -    {"dialSuffix", "DialSuffix", XtRString, sizeof(String),
756 -          offset(dialSuffix), XtRString, (XtPointer) "^M"},
757 -    {"dialCancelString", "DialCancelString", XtRString, sizeof(String),
758 -          offset(dialCancelString), XtRString, (XtPointer) "^M"},
759 -
760 -    {"dialTimeOut", "DialTimeOut", XtRInt, sizeof(int),
761 -          offset(dialTimeOut), XtRImmediate, (XtPointer) 45},
762 -    {"dialDelay", "DialDelay", XtRInt, sizeof(int),
763 -          offset(dialDelay), XtRImmediate, (XtPointer) 10},
764 -    {"dialRepeat", "DialRepeat", XtRInt, sizeof(int),
765 -          offset(dialRepeat), XtRImmediate, (XtPointer) 5},
766 -
767 -    {"connectString", "ConnectString", XtRString, sizeof(String),
768 -          offset(connectString), XtRString, (XtPointer) "CONNECT"},
769 -    {"noConnectString1", "NoConnectString1", XtRString, sizeof(String),
770 -          offset(noConnectString[0]), XtRString, (XtPointer) "NO CARRIER"},
771 -    {"noConnectString2", "NoConnectString2", XtRString, sizeof(String),
772 -          offset(noConnectString[1]), XtRString, (XtPointer) "NO DIALTONE"},
773 -    {"noConnectString3", "NoConnectString3", XtRString, sizeof(String),
774 -          offset(noConnectString[2]), XtRString, (XtPointer) "BUSY"},
775 -    {"noConnectString4", "NoConnectString4", XtRString, sizeof(String),
776 -          offset(noConnectString[3]), XtRString, (XtPointer) "VOICE"},
777 -
778 -    {"hangupBeforeDial", "HangupBeforeDial", XtRBoolean, sizeof(Boolean),
779 -          offset(hangupBeforeDial), XtRImmediate, (XtPointer)True},
780 -    {"dialAutoStart", "DialAutoStart", XtRBoolean, sizeof(Boolean),
781 -          offset(dialAutoStart), XtRImmediate, (XtPointer)False},
782 -    {"dialDirFormat", "DialDirFormat", XtRString, sizeof(String),
783 -          offset(dialDirFormat), XtRString,
784 -          (XtPointer)"%-15s %-15s %6s %1c%1c%1c %1c%1c %s"},
785 -    {"defaultPhoneEntries", "DefaultPhoneEntries", XtRString, sizeof(String),
786 -          offset(defaultPhoneEntries), XtRString, (XtPointer)NULL},
787 -
788 -    {"startupAction", "StartupAction", XtRString, sizeof(String),
789 -          offset(startupAction), XtRString, 
790 -          (XtPointer)"RunScript(startup);"},
791 -    {"postConnectAction", "PostConnectAction", XtRString, sizeof(String),
792 -          offset(postConnectAction), XtRString, (XtPointer)"Beep();"},
793 -
794 -    {"autoZmodem", "AutoZmodem", XtRBoolean, sizeof(Boolean), 
795 -          offset(autoZmodem), XtRImmediate, (XtPointer)True},
796 -    {"autoZmodemAction", "AutoZmodemAction", XtRString, sizeof(String),
797 -          offset(autoZmodemAction), XtRString, 
798 -          (XtPointer)"ShellCommand($rz);"},
799 -
800 -    {"modemVMin", "ModemVMin", XtRInt, sizeof(int),
801 -          offset(modemVMin), XtRImmediate, (XtPointer) 1},
802 -    {"ignoreModemDCD", "IgnoreModemDCD", XtRBoolean, sizeof(Boolean),
803 -          offset(ignoreModemDCD), XtRImmediate, (XtPointer) False},
804 -    {"hangupViaDTR", "HangupViaDTR", XtRBoolean, sizeof(Boolean),
805 -          offset(hangupViaDTR), XtRImmediate, (XtPointer)False},
806 -    {"modemAttentionString", "ModemAttentionString", XtRString, sizeof(String),
807 -          offset(modemAttentionString), XtRString, (XtPointer)"+++"},
808 -    {"modemHangupString", "ModemHangupString", XtRString, sizeof(String),
809 -          offset(modemHangupString), XtRString, (XtPointer)"ATH^M"},
810 -    {"hangupConfirm", "HangupConfirm", XtRBoolean, sizeof(Boolean),
811 -          offset(hangupConfirm), XtRImmediate, (XtPointer) True},
812 -    {"exitConfirm", "ExitConfirm", XtRBoolean, sizeof(Boolean),
813 -          offset(exitConfirm), XtRImmediate, (XtPointer) True},
814 -    {"neverBeep", "NeverBeep", XtRBoolean, sizeof(Boolean),
815 -          offset(neverBeep), XtRImmediate, (XtPointer)False},
816 -
817 -    {"defaultDirectory", "DefaultDirectory", XtRString, sizeof(String),
818 -          offset(defaultDirectory), XtRString, (XtPointer) "~/.seyon"},
819 -    {"scriptDirectory", "scriptDirectory", XtRString, sizeof(String),
820 -          offset(scriptDirectory), XtRString, (XtPointer) NULL},
821 -    {"startupFile", "StartupFile", XtRString, sizeof(String),
822 -          offset(startupFile), XtRString, (XtPointer) "startup"},
823 -    {"phoneFile", "PhoneFile", XtRString, sizeof(String),
824 -          offset(phoneFile), XtRString, (XtPointer) "phonelist"},
825 -    {"protocolsFile", "ProtocolsFile", XtRString, sizeof(String),
826 -          offset(protocolsFile), XtRString, (XtPointer) "protocols"},
827 -    {"captureFile", "CaptureFile", XtRString, sizeof(String),
828 -          offset(captureFile), XtRString, (XtPointer) "capture"},
829 -    {"helpFile", "HelpFile", XtRString, sizeof(String),
830 -          offset(helpFile), XtRString, (XtPointer) HELPFILE},
831 -
832 -    {"modemStatusInterval", "ModemStatusInterval", XtRInt, sizeof(int),
833 -          offset(modemStatusInterval), XtRImmediate, (XtPointer) 5},
834 -
835 -    {"idleGuard", "IdleGuard", XtRBoolean, sizeof(Boolean),
836 -          offset(idleGuard), XtRImmediate, (XtPointer) False},
837 -    {"idleGuardInterval", "IdleGuardInterval", XtRInt, sizeof(int),
838 -          offset(idleGuardInterval), XtRImmediate, (XtPointer) 300},
839 -    {"idleGuardString", "IdleGuardString", XtRString, sizeof(String),
840 -          offset(idleGuardString), XtRImmediate, (XtPointer) " ^H"},
841 -
842 -    {"showFunMessages", "ShowFunMessages", XtRBoolean, sizeof(Boolean),
843 -          offset(showFunMessages), XtRImmediate, (XtPointer) True},
844 -    {"funMessagesInterval", "FunMessagesInterval", XtRInt, sizeof(int),
845 -          offset(funMessagesInterval), XtRImmediate, (XtPointer) 15},
846 -    {"funMessages", "FunMessages", XtRStringArray, sizeof(String*),
847 -          offset(funMessages), XtRStringArray, (XtPointer) NULL},
848 -  };
849 +        {"defaultBPS", "DefaultBPS", XtRString, sizeof(String),
850 +         offset(defaultBPS), XtRString, (XtPointer) "9600"},
851 +        {"defaultBits", "DefaultBits", XtRInt, sizeof(int),
852 +         offset(defaultBits), XtRImmediate, (XtPointer) 8},
853 +        {"defaultParity", "DefaultParity", XtRInt, sizeof(int),
854 +         offset(defaultParity), XtRImmediate, (XtPointer) 0},
855 +        {"defaultStopBits", "DefaultStopBits", XtRInt, sizeof(int),
856 +         offset(defaultStopBits), XtRImmediate, (XtPointer) 1},
857 +        {"stripHighBit", "StripHighBit", XtRBoolean, sizeof(Boolean),
858 +         offset(stripHighBit), XtRImmediate, (XtPointer) False},
859 +        {"backspaceTranslation", "BackspaceTranslation", XtRBoolean,
860 +         sizeof(Boolean), offset(backspaceTranslation), XtRImmediate,
861 +         (XtPointer) False},
862 +        {"metaKeyTranslation", "MetaKeyTranslation", XtRBoolean,
863 +         sizeof(Boolean), offset(metaKeyTranslation), XtRImmediate,
864 +         (XtPointer) True},
865 +        {"xonxoffFlowControl", "XonxoffFlowControl", XtRBoolean,
866 +         sizeof(Boolean), offset(xonxoffFlowControl), XtRImmediate,
867 +         (XtPointer) False},
868 +        {"rtsctsFlowControl", "RtsctsFlowControl", XtRBoolean,
869 +         sizeof(Boolean), offset(rtsctsFlowControl), XtRImmediate,
870 +         (XtPointer) False},
871 +        {"newlineTranslation", "NewlineTranslation", XtRString,
872 +         sizeof(String), offset(newlineTranslation), XtRImmediate,
873 +         (XtPointer) "cr"},
874 +
875 +        {"dialPrefix", "DialPrefix", XtRString, sizeof(String),
876 +         offset(dialPrefix), XtRString, (XtPointer) "ATDT"},
877 +        {"dialSuffix", "DialSuffix", XtRString, sizeof(String),
878 +         offset(dialSuffix), XtRString, (XtPointer) "^M"},
879 +        {"dialCancelString", "DialCancelString", XtRString, sizeof(String),
880 +         offset(dialCancelString), XtRString, (XtPointer) "^M"},
881 +
882 +        {"dialTimeOut", "DialTimeOut", XtRInt, sizeof(int),
883 +         offset(dialTimeOut), XtRImmediate, (XtPointer) 45},
884 +        {"dialDelay", "DialDelay", XtRInt, sizeof(int),
885 +         offset(dialDelay), XtRImmediate, (XtPointer) 10},
886 +        {"dialRepeat", "DialRepeat", XtRInt, sizeof(int),
887 +         offset(dialRepeat), XtRImmediate, (XtPointer) 5},
888 +
889 +        {"connectString", "ConnectString", XtRString, sizeof(String),
890 +         offset(connectString), XtRString, (XtPointer) "CONNECT"},
891 +        {"noConnectString1", "NoConnectString1", XtRString, sizeof(String),
892 +         offset(noConnectString[0]), XtRString, (XtPointer) "NO CARRIER"},
893 +        {"noConnectString2", "NoConnectString2", XtRString, sizeof(String),
894 +         offset(noConnectString[1]), XtRString, (XtPointer) "NO DIALTONE"},
895 +        {"noConnectString3", "NoConnectString3", XtRString, sizeof(String),
896 +         offset(noConnectString[2]), XtRString, (XtPointer) "BUSY"},
897 +        {"noConnectString4", "NoConnectString4", XtRString, sizeof(String),
898 +         offset(noConnectString[3]), XtRString, (XtPointer) "VOICE"},
899 +
900 +        {"hangupBeforeDial", "HangupBeforeDial", XtRBoolean, sizeof(Boolean),
901 +         offset(hangupBeforeDial), XtRImmediate, (XtPointer)True},
902 +        {"dialAutoStart", "DialAutoStart", XtRBoolean, sizeof(Boolean),
903 +         offset(dialAutoStart), XtRImmediate, (XtPointer)False},
904 +        {"dialDirFormat", "DialDirFormat", XtRString, sizeof(String),
905 +         offset(dialDirFormat), XtRString,
906 +         (XtPointer)"%-15s %-15s %6s %1c%1c%1c %1c%1c %s"},
907 +        {"defaultPhoneEntries", "DefaultPhoneEntries", XtRString, sizeof(String),
908 +         offset(defaultPhoneEntries), XtRString, (XtPointer)NULL},
909 +
910 +        {"startupAction", "StartupAction", XtRString, sizeof(String),
911 +         offset(startupAction), XtRString, 
912 +         (XtPointer)"RunScript(startup);"},
913 +        {"postConnectAction", "PostConnectAction", XtRString, sizeof(String),
914 +         offset(postConnectAction), XtRString, (XtPointer)"Beep();"},
915 +
916 +        {"autoZmodem", "AutoZmodem", XtRBoolean, sizeof(Boolean), 
917 +         offset(autoZmodem), XtRImmediate, (XtPointer)True},
918 +        {"autoZmodemAction", "AutoZmodemAction", XtRString, sizeof(String),
919 +         offset(autoZmodemAction), XtRString, 
920 +         (XtPointer)"ShellCommand($rz);"},
921 +
922 +        {"modemVMin", "ModemVMin", XtRInt, sizeof(int),
923 +         offset(modemVMin), XtRImmediate, (XtPointer) 1},
924 +        {"ignoreModemDCD", "IgnoreModemDCD", XtRBoolean, sizeof(Boolean),
925 +         offset(ignoreModemDCD), XtRImmediate, (XtPointer) False},
926 +        {"hangupViaDTR", "HangupViaDTR", XtRBoolean, sizeof(Boolean),
927 +         offset(hangupViaDTR), XtRImmediate, (XtPointer)False},
928 +        {"modemAttentionString", "ModemAttentionString", XtRString, sizeof(String),
929 +         offset(modemAttentionString), XtRString, (XtPointer)"+++"},
930 +        {"modemHangupString", "ModemHangupString", XtRString, sizeof(String),
931 +         offset(modemHangupString), XtRString, (XtPointer)"ATH^M"},
932 +        {"hangupConfirm", "HangupConfirm", XtRBoolean, sizeof(Boolean),
933 +         offset(hangupConfirm), XtRImmediate, (XtPointer) True},
934 +        {"exitConfirm", "ExitConfirm", XtRBoolean, sizeof(Boolean),
935 +         offset(exitConfirm), XtRImmediate, (XtPointer) True},
936 +        {"neverBeep", "NeverBeep", XtRBoolean, sizeof(Boolean),
937 +         offset(neverBeep), XtRImmediate, (XtPointer)False},
938 +
939 +        {"defaultDirectory", "DefaultDirectory", XtRString, sizeof(String),
940 +         offset(defaultDirectory), XtRString, (XtPointer) "~/.seyon"},
941 +        {"scriptDirectory", "scriptDirectory", XtRString, sizeof(String),
942 +         offset(scriptDirectory), XtRString, (XtPointer) NULL},
943 +        {"startupFile", "StartupFile", XtRString, sizeof(String),
944 +         offset(startupFile), XtRString, (XtPointer) "startup"},
945 +        {"phoneFile", "PhoneFile", XtRString, sizeof(String),
946 +         offset(phoneFile), XtRString, (XtPointer) "phonelist"},
947 +        {"protocolsFile", "ProtocolsFile", XtRString, sizeof(String),
948 +         offset(protocolsFile), XtRString, (XtPointer) "protocols"},
949 +        {"captureFile", "CaptureFile", XtRString, sizeof(String),
950 +         offset(captureFile), XtRString, (XtPointer) "capture"},
951 +        {"helpFile", "HelpFile", XtRString, sizeof(String),
952 +         offset(helpFile), XtRString, (XtPointer) HELPFILE},
953 +
954 +        {"modemStatusInterval", "ModemStatusInterval", XtRInt, sizeof(int),
955 +         offset(modemStatusInterval), XtRImmediate, (XtPointer) 5},
956 +
957 +        {"idleGuard", "IdleGuard", XtRBoolean, sizeof(Boolean),
958 +         offset(idleGuard), XtRImmediate, (XtPointer) False},
959 +        {"idleGuardInterval", "IdleGuardInterval", XtRInt, sizeof(int),
960 +         offset(idleGuardInterval), XtRImmediate, (XtPointer) 300},
961 +        {"idleGuardString", "IdleGuardString", XtRString, sizeof(String),
962 +         offset(idleGuardString), XtRImmediate, (XtPointer) " ^H"},
963 +
964 +        {"showFunMessages", "ShowFunMessages", XtRBoolean, sizeof(Boolean),
965 +         offset(showFunMessages), XtRImmediate, (XtPointer) True},
966 +        {"funMessagesInterval", "FunMessagesInterval", XtRInt, sizeof(int),
967 +         offset(funMessagesInterval), XtRImmediate, (XtPointer) 15},
968 +        {"funMessages", "FunMessages", XtRStringArray, sizeof(String*),
969 +         offset(funMessages), XtRStringArray, (XtPointer) NULL},
970 +    };
971  
972  #undef offset
973  
974 -  XtSetTypeConverter(XtRString, XtRStringArray, CvtStringToStringArray,
975 -                                        NULL, 0, XtCacheNone, NULL);
976 +    XtSetTypeConverter(XtRString, XtRStringArray, CvtStringToStringArray,
977 +                  NULL, 0, XtCacheNone, NULL);
978  
979 -  XtGetApplicationResources(topLevel, (XtPointer)&qres, resources,
980 -                                                       XtNumber(resources), NULL, 0);
981 +    XtGetApplicationResources(topLevel, (XtPointer)&qres, resources,
982 +                       XtNumber(resources), NULL, 0);
983  }
984 --- seyon-2.20c.orig/SeDial.c
985 +++ seyon-2.20c/SeDial.c
986 @@ -89,7 +89,7 @@
987         {XMapRaised(XtDisplay(widget), XtWindow(popup)); return;}
988          
989    if (disItems[0] == NULL) {
990 -    strcpy(phoneFile, qres.phoneFile);
991 +    strncpy(phoneFile, qres.phoneFile, REG_BUF);
992      if (ReadParsePhoneFile(phoneFile, disItems) < 0) return;
993  
994         form = XtParent(widget);
995 @@ -328,7 +328,7 @@
996    Widget          dialog = XtParent(widget);
997    char            phoneNumber[SM_BUF];
998  
999 -  strcpy(phoneNumber, XawDialogGetValueString(dialog));
1000 +  strncpy(phoneNumber, XawDialogGetValueString(dialog), SM_BUF);
1001    DestroyShell(dialog);
1002    ExecManualDial(XtParent(GetShell(widget)), phoneNumber);
1003  }
1004 @@ -341,7 +341,7 @@
1005    inhibit_child = True;
1006    manualDial = True;
1007  
1008 -  strcpy(phone_number, phoneNumber);
1009 +  strncpy(phone_number, phoneNumber, SM_BUF);
1010  
1011    dialTry = 1;
1012    PreProcessPrep();
1013 @@ -442,15 +442,15 @@
1014    if ((ptr = (char*)strstr(raw, keyword)) != NULL) {
1015      ptr += strlen(keyword);
1016      if (strncmp(ptr, "CURRENT", 3)) {
1017 -      strcpy(buf, ptr);
1018 +      strncpy(buf, ptr, REG_BUF);
1019        GetWord(buf, wrd);
1020 -      strcpy(var, wrd);
1021 +      strncpy(var, wrd, sizeof(*var));
1022      }
1023      else
1024 -      strcpy(var, "CURRENT");
1025 +      strncpy(var, "CURRENT", sizeof(*var));
1026    }
1027    else
1028 -    strcpy(var, def);
1029 +    strncpy(var, def, sizeof(*var));
1030  }
1031  
1032  void
1033 @@ -463,8 +463,8 @@
1034    char            svar[TIN_BUF],
1035                    sdef[TIN_BUF];
1036  
1037 -  sprintf(svar, "%d", *var);
1038 -  sprintf(sdef, "%d", def);
1039 +  sprintf(svar, "%d", *var); /* safe */
1040 +  sprintf(sdef, "%d", def);  /* safe */
1041  
1042    GetStrField(raw, keyword, svar, sdef);
1043  
1044 @@ -496,7 +496,7 @@
1045    else {
1046      signal(SIGALRM, SIG_DFL);
1047      alarm(0);
1048 -       strcpy(dialMsg, "TIMEOUT");
1049 +       strncpy(dialMsg, "TIMEOUT", SM_BUF);
1050      longjmp(dial_env, 1);
1051    }
1052  }
1053 @@ -514,6 +514,8 @@
1054                   *bufPtr,
1055                    dialString[REG_BUF];
1056    int             i,
1057 +/*                  length, */
1058 +                  length_remaining,
1059                    k;
1060  
1061    if (setjmp(dial_env) != 0) {
1062 @@ -534,8 +536,8 @@
1063    if (!manualDial) {
1064  
1065      itemName = ddItems[k]->name;
1066 -    sprintf(dialString, "\r%s %s%s", ddItems[k]->prefix, ddItems[k]->number,
1067 -           ddItems[k]->suffix);
1068 +    strncpy(dialString, FmtString("\r%s %s%s", ddItems[k]->prefix, 
1069 +             ddItems[k]->number, ddItems[k]->suffix), REG_BUF);
1070  
1071      if (mbaud(ddItems[k]->baud) < 0)
1072        se_warningf("invalid BPS value in dialing directory: %s",
1073 @@ -552,14 +554,23 @@
1074    }
1075    else {
1076      itemName = phone_number;
1077 -    sprintf(dialString, "\r%s %s%s", qres.dialPrefix, phone_number,
1078 -           qres.dialSuffix);
1079 +    strncpy(dialString, FmtString("\r%s %s%s", qres.dialPrefix, phone_number,
1080 +           qres.dialSuffix), REG_BUF);
1081    }
1082  
1083 +  length_remaining = SM_BUF;
1084    if (dialTry == 1)
1085 -    sprintf(dialMsg, "Dialing %s", itemName);
1086 +  {
1087 +    strncpy(dialMsg, "Dialing ", length_remaining);
1088 +    length_remaining -= strlen("Dialing ");
1089 +    strncat(dialMsg, itemName, length_remaining);
1090 +  }
1091    else
1092 -    sprintf(dialMsg, "Redialing:%d %s", dialTry, itemName);
1093 +    strncpy(dialMsg, "Redialing ", length_remaining);
1094 +    length_remaining -= strlen("Redialing ");
1095 +    sprintf(dialMsg, "%1.1d ", dialTry);
1096 +    length_remaining -= 2;
1097 +    strncat(dialMsg, itemName, length_remaining);
1098  
1099    ProcRequest(SET_MESSAGE, "Setting Up...", "");
1100  
1101 @@ -589,7 +600,7 @@
1102      for (i = 0; i < 3; i++)
1103        if (*(bufPtr = StripSpace(qres.noConnectString[i])) && 
1104                   strncmp(modemResponse, bufPtr, strlen(bufPtr)) == 0) {
1105 -               strcpy(dialMsg, modemResponse);
1106 +               strncpy(dialMsg, modemResponse, SM_BUF);
1107                 longjmp(dial_env, 1);
1108           }
1109    }    /* while(1)... */
1110 @@ -601,15 +612,20 @@
1111       String          disItems[];
1112  {
1113    FILE           *fp;
1114 +  FILE           *devnull;
1115    String          rawItems[MAX_ENT + 1];
1116    char           *buf,
1117                   *sHold,
1118                    disItemsBuf[REG_BUF];
1119 +  char            filename[LRG_BUF];
1120    int             i,
1121                    n,
1122 +                  length,
1123                    iHold;
1124  
1125 -  if ((fp = open_file(fname, qres.defaultDirectory)) == NULL)
1126 +  strncpy(filename, fname, REG_BUF);
1127 +
1128 +  if ((fp = open_file(filename, REG_BUF, qres.defaultDirectory)) == NULL)
1129      return -1;
1130  
1131    ReadCommentedFile(fp, rawItems);
1132 @@ -623,11 +639,9 @@
1133  
1134      /* Find the number */
1135      GetWord(buf, ddItems[i]->number);
1136 -/*    strcpy(ddItems[i]->number, GetFirstWord(buf));*/
1137  
1138      /* Find the name */
1139      GetWord((buf = lptr), ddItems[i]->name);
1140 -/*    strcpy(ddItems[i]->name, GetNextWord());*/
1141  
1142      /* Find other stuff */
1143      GetStrField(buf, "BPS=", ddItems[i]->baud, qres.defaultBPS);
1144 @@ -643,8 +657,20 @@
1145    FreeList(rawItems);
1146    FreeList(disItems);
1147  
1148 +  /* Ick... This is horrible - using a user-provided format string
1149 +     means we have no easy way of limiting string length. HACK HACK
1150 +     HACK Use fprintf to output to /dev/null and count the number of
1151 +     bytes... It would be nice if we could rely on having snprintf() */
1152 +
1153 +  devnull = fopen("/dev/null", "r+");
1154 +  if(NULL == devnull)
1155 +  {
1156 +      printf("Open /dev/null failed!?!\n");
1157 +      return 1;
1158 +  }
1159 +
1160    for (n = 0; n < i; n++) {
1161 -    sprintf(disItemsBuf, qres.dialDirFormat,
1162 +    length = fprintf(devnull, qres.dialDirFormat,
1163             ddItems[n]->name,
1164             ddItems[n]->number,
1165             strncmp((sHold = ddItems[n]->baud), "CUR", 3) ? sHold : "????",
1166 @@ -658,10 +684,33 @@
1167             strcmp(sHold, qres.dialSuffix) ? 'S' : 'D' : '?',
1168             ddItems[n]->script);
1169  
1170 -    disItemsBuf[SM_BUF - 1] = '\0';
1171 -    disItems[n] = XtNewString(disItemsBuf);
1172 +    if(REG_BUF >= length)
1173 +    {
1174 +        sprintf(disItemsBuf, qres.dialDirFormat,
1175 +             ddItems[n]->name,
1176 +             ddItems[n]->number,
1177 +             strncmp((sHold = ddItems[n]->baud), "CUR", 3) ? sHold : "????",
1178 +             (iHold = ddItems[n]->bits) == 100 ? '?' : itoa(iHold),
1179 +             (iHold = ddItems[n]->parity) ? (iHold == 1 ? 'O' :
1180 +                                       (iHold == 2 ? 'E' : '?')) : 'N',
1181 +             (iHold = ddItems[n]->stopBits) == 100 ? '?' : itoa(iHold),
1182 +             strncmp((sHold = ddItems[n]->prefix), "CUR", 3) ?
1183 +             strcmp(sHold, qres.dialPrefix) ? 'P' : 'D' : '?',
1184 +             strncmp((sHold = ddItems[n]->suffix), "CUR", 3) ?
1185 +             strcmp(sHold, qres.dialSuffix) ? 'S' : 'D' : '?',
1186 +             ddItems[n]->script);
1187 +        disItemsBuf[SM_BUF - 1] = '\0';
1188 +        disItems[n] = XtNewString(disItemsBuf);
1189 +    }
1190 +    else
1191 +    {
1192 +        printf("ReadParsePhoneFile: attempted overrun: %s\n",ddItems[n]->name);
1193 +        fclose(devnull);
1194 +        return 1;
1195 +    }
1196    }
1197    disItems[n] = NULL;
1198 +  fclose(devnull);
1199  
1200    return 0;
1201  }
1202 --- seyon-2.20c.orig/SePort.c
1203 +++ seyon-2.20c/SePort.c
1204 @@ -51,7 +51,7 @@
1205  #ifdef linux
1206  #include <linux/serial.h>
1207  #include <sys/ioctl.h>
1208 -#include <linux/fs.h>
1209 +/* #include <linux/fs.h> */
1210  #include <linux/tty.h>
1211  #endif
1212  #endif
1213 @@ -127,20 +127,30 @@
1214  
1215  void
1216  MdmPutString(s)
1217 -     char           *s;
1218 +    char           *s;
1219  {
1220 -  char            c;
1221 +    char            c;
1222  
1223 -  usleep(MDELAY);
1224 -  for (; (c = *s); s++) {
1225 -    if (*s == '^' && *(s + 1))
1226 -      if (*(++s) == '^') c = *s;
1227 -      else c = *s & 0x1f;
1228 -
1229 -    if (c == '~') sleep(1);
1230 -    else send_tbyte(c);
1231      usleep(MDELAY);
1232 -  }
1233 +    for (; (c = *s); s++) 
1234 +    {
1235 +        if (*s == '^' && *(s + 1))
1236 +        {
1237 +         if (*(++s) == '^') 
1238 +         {
1239 +             c = *s;
1240 +         }
1241 +         else 
1242 +         {
1243 +             c = *s & 0x1f;
1244 +         }
1245 +        }
1246 +        if (c == '~') 
1247 +         sleep(1);
1248 +        else 
1249 +         send_tbyte(c);
1250 +        usleep(MDELAY);
1251 +    }
1252  }
1253  
1254  void
1255 @@ -150,10 +160,7 @@
1256                      *b,
1257                      *c;
1258  {
1259 -  char            buf[REG_BUF];
1260 -
1261 -  sprintf(buf, fmt, a, b, c);
1262 -  MdmPutString(buf);
1263 +    MdmPutString(FmtString(fmt,a,b,c));
1264  }
1265  
1266  void
1267 @@ -224,7 +231,7 @@
1268          int             newModem;
1269  {
1270    static Boolean  useModemControl = True;
1271 -  int             retStat;
1272 +  int             retStat = 0;
1273  
1274    if (newModem) useModemControl = True;
1275  
1276 @@ -350,11 +357,11 @@
1277  
1278  char           *
1279  mport(s)                       /* get/set port string */
1280 -     char           *s;
1281 +    char           *s;
1282  {
1283 -  if (s != NULL)
1284 -    strcpy(modem_port, s);
1285 -  return (modem_port);
1286 +    if (s != NULL)
1287 +        strncpy(modem_port, s, sizeof(modem_port));
1288 +    return (modem_port);
1289  }
1290  
1291  int
1292 @@ -946,16 +953,13 @@
1293  }
1294  
1295  void
1296 -sendf_slowly(format, a, b, c)
1297 -     char           *format,
1298 +sendf_slowly(fmt, a, b, c)
1299 +     char           *fmt,
1300                      *a,
1301                      *b,
1302                      *c;
1303  {
1304 -  char            buffer[SM_BUF];
1305 -
1306 -  sprintf(buffer, format, a, b, c);
1307 -  send_slowly(buffer);
1308 +  send_slowly(FmtString(fmt,a,b,c));
1309  }
1310  
1311  void
1312 @@ -989,7 +993,7 @@
1313  LockModem(modem)
1314          String modem;
1315  {
1316 -  strcpy(modem_port, modem);
1317 +  strncpy(modem_port, modem, REG_BUF);
1318    return lock_tty();
1319  }
1320  
1321 @@ -1004,50 +1008,82 @@
1322  int
1323  lock_tty()
1324  {
1325 -  int             lfd;
1326 -  pid_t           pid,
1327 -                  lckpid;
1328 -  char           *modemname;
1329 +    int             lfd;
1330 +    pid_t           pid,
1331 +        lckpid;
1332 +    char           *modemname;
1333  #if LF_USE_ASCII_PID
1334 -  char            pidstr[20],
1335 -                  lckpidstr[20];
1336 -  int             nb;
1337 +    char            pidstr[20],
1338 +        lckpidstr[20];
1339 +    int             nb;
1340  #endif
1341  #if LF_USE_DEV_NUMBERS
1342 -  struct stat  mbuf;
1343 +    struct stat  mbuf;
1344  #endif
1345  
1346 -  /* Get our PID, and initialize the filename strings */
1347 -  pid = getpid();
1348 +    /* Get our PID, and initialize the filename strings */
1349 +    pid = getpid();
1350  
1351  #if !LF_USE_DEV_NUMBERS
1352 -  modemname = strrchr(modem_port, '/');
1353 -  sprintf(lckf, "%s/%s%s", LF_PATH, LF_PREFIX, 
1354 -                 (modemname ? (modemname + 1) : modem_port));
1355 -#else
1356 -  if(stat(modem_port, &mbuf) < 0) {
1357 -       SePErrorF("could not stat modem port %s", modem_port, "", "");
1358 -       return -1;
1359 -  }
1360 -  sprintf(lckf,"%s/%s%03u.%03u.%03u", LF_PATH, LF_PREFIX, major(mbuf.st_dev),
1361 -                 major(mbuf.st_rdev), minor(mbuf.st_rdev));
1362 +    modemname = strrchr(modem_port, '/');
1363 +    if(modemname)
1364 +    {
1365 +        if( SM_BUF > (1 + strlen(LF_PATH) + strlen(LF_PREFIX) + strlen(modemname)))
1366 +         sprintf(lckf, "%s/%s%s", LF_PATH, LF_PREFIX, (modemname + 1));
1367 +        else
1368 +        {
1369 +         SePErrorF("Buffer too small for lock filename in lock_tty(): %s", modemname, "", "");
1370 +         return -1;
1371 +        }
1372 +    }
1373 +    else
1374 +    {
1375 +        if( SM_BUF > (1 + strlen(LF_PATH) + strlen(LF_PREFIX) + strlen(modem_port)))
1376 +         sprintf(lckf, "%s/%s%s", LF_PATH, LF_PREFIX, (modem_port));
1377 +        else
1378 +        {
1379 +         SePErrorF("Buffer too small for lock filename in lock_tty(): %s", modem_port, "", "");
1380 +         return -1;
1381 +        }
1382 +    }
1383 +
1384 +#else
1385 +    if(stat(modem_port, &mbuf) < 0) {
1386 +        SePErrorF("could not stat modem port %s", modem_port, "", "");
1387 +        return -1;
1388 +    }
1389 +    if( SM_BUF > (10 + strlen(LF_PATH) + strlen(LF_PREFIX)))
1390 +        sprintf(lckf,"%s/%s%03u.%03u.%03u", LF_PATH, LF_PREFIX, major(mbuf.st_dev),
1391 +             major(mbuf.st_rdev), minor(mbuf.st_rdev));
1392 +    else
1393 +    {
1394 +        SePErrorF("Buffer too small for lock filename in lock_tty():", "", "", "");
1395 +        return -1;
1396 +    }
1397  #endif /* LF_USE_DEV_NUMBERS */
1398  
1399 -  sprintf(ltmp, "%s/%s%d", LF_PATH, "LTMP.", pid);
1400 -  /* Create the LTMP.<pid> file and scribble our PID in it */
1401 -  unlink(ltmp);
1402 -  if ((lfd = creat(ltmp, 0644)) == -1) {
1403 -    SePErrorF("Could not create temporary lock file %s", ltmp, "", "");
1404 -    return -1;
1405 -  }
1406 +    if( SM_BUF > (11 + strlen(LF_PATH)))
1407 +        sprintf(ltmp, "%s/%s%d", LF_PATH, "LTMP.", pid);
1408 +    else
1409 +    {
1410 +        SePErrorF("Buffer too small for ltmp filename in lock_tty():", "", "", "");
1411 +        return -1;
1412 +    }
1413 +    /* Create the LTMP.<pid> file and scribble our PID in it */
1414 +    unlink(ltmp);
1415 +    if ((lfd = creat(ltmp, 0644)) == -1) {
1416 +        SePErrorF("Could not create temporary lock file %s", ltmp, "", "");
1417 +        return -1;
1418 +    }
1419  
1420  #if LF_USE_ASCII_PID
1421 -  sprintf(pidstr, "%10d\n", pid);
1422 -  write(lfd, pidstr, 11);
1423 +    /* pidstr is easily large enough */
1424 +    sprintf(pidstr, "%10d\n", pid);
1425 +    write(lfd, pidstr, 11);
1426  #else
1427 -  write(lfd, (char*)&pid, sizeof(pid));
1428 +    write(lfd, (char*)&pid, sizeof(pid));
1429  #endif
1430 -  close(lfd);
1431 +    close(lfd);
1432  
1433    /*
1434     * Attempt to link directly - if it works, we're done.
1435 --- seyon-2.20c.orig/protocols
1436 +++ seyon-2.20c/protocols
1437 @@ -6,7 +6,7 @@
1438  # you have to use the resources 
1439  # zmodemAutoDownload and
1440  # zmodemAutoDownloadCommand for that.
1441 -# see the manula page for more details.
1442 +# see the manual page for more details.
1443  
1444  # the format is simple.
1445  
1446 @@ -24,9 +24,9 @@
1447  
1448  # you can put comments on a single line
1449  # or at the end of a line
1450 -
1451 -regular_zmodem_dl    "$ cd /usr/dl; rz -vv" n # like in here
1452 -
1453 +#
1454 +#regular_zmodem_dl    "$ cd /usr/dl; rz -vv" n # like in here
1455 +#
1456  # blank lines are OK too, for readability.
1457  
1458  # the title has to be either a single word, like the above
1459 @@ -34,21 +34,29 @@
1460  
1461  # you put anything instead of y as long as it starts
1462  # with y: y, Y, yes, yep ..etc.
1463 -
1464 -"regular zmodem ul"  "$ cd /usr/src; sz -vv" y
1465 -
1466 +#
1467 +#"regular zmodem ul"  "$ cd /usr/src; sz -vv" y
1468 +#
1469  # anything that doesn't start with a y is a no
1470  # e.g. n, N, NO, Not, nope, nien, nono ..etc.
1471  # even hello, but the use of words that doesn't start
1472  # with n is highly discouraged
1473 -
1474 -graphic_zmodem_dl    "cd /usr/dl; grz        No
1475 -xrz3D                "$cd /usr/dl; xrz"      NO
1476 -
1477 +#
1478 +#graphic_zmodem_dl    "cd /usr/dl; grz        No
1479 +#xrz3D                "$cd /usr/dl; xrz"      NO
1480 +#
1481  # here is my own protocols file
1482  # notice how I make it clear to myself
1483  # whether I'm uploading or downloading
1484 -
1485 -"SEND - Zmodem" "$cd /usr/src; sz -vv" y
1486 -"RECEIVE - Reg. Zmodem" "$cd /usr/dl; rz -vv"  n
1487 -"RECEIVE - Xrz3D" "$cd /usr/dl; xrz" n
1488 +#
1489 +#"SEND - Zmodem" "$cd /usr/src; sz -vv" y
1490 +#"RECEIVE - Reg. Zmodem" "$cd /usr/dl; rz -vv"  n
1491 +#"RECEIVE - Xrz3D" "$cd /usr/dl; xrz" n
1492 +
1493 +"Zmodem - RECEIVE"      "$lrz" n
1494 +"Ymodem - RECEIVE"      "$lrb" n
1495 +"Xmodem - RECEIVE"      "$lrx" y
1496 +
1497 +"Zmodem - SEND"         "$lsz" y
1498 +"Ymodem - SEND"         "$lsb" y
1499 +"Xmodem - SEND"         "$lsx" y
1500 --- seyon-2.20c.orig/Seyon.ad.h
1501 +++ seyon-2.20c/Seyon.ad.h
1502 @@ -1,3 +1,4 @@
1503 +"#include \"/etc/X11/seyon/Seyon-modem\"",
1504  "*.title: Seyon Command Center",
1505  "*.iconName: Seyon",
1506  "*input: on",
1507 @@ -21,7 +22,7 @@
1508  "*XfwfMultiList.defaultColumns: 1",
1509  "*XfwfMultiList.verticaList: true",
1510  "*XfwfMultiList.maxSelectable: 100",
1511 -"*XfwfMultiList.Translations: #replcae \\n\
1512 +"*XfwfMultiList.Translations: #replace \\n\
1513         <Btn1Down>(2): Select() Notify() \\n\
1514         <Btn1Down>: Toggle() \\n\
1515         <Btn2Down>: Select() Notify() \\n\
1516 @@ -192,17 +193,6 @@
1517  "*statusBox.rts.label: RTS",
1518  "*statusBox.cts.label: CTS",
1519  "*statusBox.rng.label: RNG",
1520 -"*quickKeyBox.Command.font: 6x10",
1521 -"*quickKey1.visible: on",
1522 -"*quickKey2.visible: on",
1523 -"*quickKey3.visible: on",
1524 -"*quickKey4.visible: on",
1525 -"*quickKey5.visible: on",
1526 -"*quickKey1.label: Athena",
1527 -"*quickKey2.label: Ch1",
1528 -"*quickKey3.label: UpMail",
1529 -"*quickKey4.label: DivMsg",
1530 -"*quickKey5.label: Local",
1531  "*funMessages: \
1532         \"Hi there! Helloooooooooo!\" \
1533         \"Hugged your computer today?\" \
1534 @@ -217,6 +207,7 @@
1535         \"In stereo (where available)\" \
1536         \"Have something funny? send it!\" \
1537         \"I've fallen and I can't get up!\"",
1538 +"+*showFunMessages: off",
1539  "*notImplemented*title: Seyon Feature",
1540  "*notImplemented.dialog.label: \
1541  This feature is not yet implemented\\n\
1542 --- seyon-2.20c.orig/SeErr.c
1543 +++ seyon-2.20c/SeErr.c
1544 @@ -107,28 +107,26 @@
1545  
1546  #ifdef notdef
1547  void
1548 -SePopupWarningF(parent, fmt, a, b, c, d)
1549 +SePopupWarningF(parent, fmt, a, b, c)
1550       Widget          parent;
1551       String          fmt,
1552                       a,
1553                       b,
1554 -                     c,
1555 -                     d;
1556 +                     c;
1557  {
1558    SePopupNoticeF(parent, 0, "Seyon Warning", DestroyParentPopup,
1559 -                fmt, a, b, c, d);
1560 +                fmt, a, b, c);
1561  }
1562  
1563  void
1564 -SePopupInitWarningF(parent, fmt, a, b, c, d)
1565 +SePopupInitWarningF(parent, fmt, a, b, c)
1566       Widget          parent;
1567       String          fmt,
1568                       a,
1569                       b,
1570 -                     c,
1571 -                     d;
1572 +                     c;
1573  {
1574    SePopupNoticeF(parent, 0, "Seyon Initialization Warning",
1575 -                DestroyParentPopup, fmt, a, b, c, d);
1576 +                DestroyParentPopup, fmt, a, b, c);
1577  }
1578  #endif
1579 --- seyon-2.20c.orig/SeSubs.c
1580 +++ seyon-2.20c/SeSubs.c
1581 @@ -45,9 +45,9 @@
1582  
1583  void
1584  toggle_flag(flag)
1585 -     Boolean        *flag;
1586 +    Boolean        *flag;
1587  {
1588 -  *flag = !*flag;
1589 +    *flag = !*flag;
1590  }
1591  
1592  /*
1593 @@ -56,10 +56,10 @@
1594  
1595  void
1596  show(msg)
1597 -     char           *msg;
1598 +    char           *msg;
1599  {
1600 -  fprintf(tfp, "%s\r\n", msg);
1601 -  fflush(tfp);
1602 +    fprintf(tfp, "%s\r\n", msg);
1603 +    fflush(tfp);
1604  }
1605  
1606  /*
1607 @@ -68,105 +68,96 @@
1608  
1609  void
1610  showf(fmt, a, b, c)
1611 -     char           *fmt,
1612 -                    *a,
1613 -                    *b,
1614 -                    *c;
1615 +    char           *fmt,
1616 +    *a,
1617 +    *b,
1618 +    *c;
1619  {
1620 -  fprintf(tfp, fmt, a, b, c);
1621 -  fprintf(tfp, "\r\n");
1622 +    fprintf(tfp, fmt, a, b, c);
1623 +    fprintf(tfp, "\r\n");
1624  }
1625  
1626  void
1627  SeError(msg)
1628 -     char           *msg;
1629 +    char           *msg;
1630  {
1631 -  char            buf[REG_BUF];
1632 +    char            buf[REG_BUF];
1633  
1634 -  sprintf(buf, "\r>> Error: %s.", msg);
1635 -  show(buf);
1636 +    strncpy(buf, "\r>> Error: ",REG_BUF);
1637 +    strncat(buf, msg, REG_BUF-12);
1638 +    buf[REG_BUF - 1] = 0; /* Null-terminate to be sure */
1639 +    show(buf);
1640  }
1641  
1642  void
1643  SeErrorF(fmt, a, b, c)
1644 -     char           *fmt,
1645 -                    *a,
1646 -                    *b,
1647 -                    *c;
1648 +    char           *fmt,
1649 +    *a,
1650 +    *b,
1651 +    *c;
1652  {
1653 -  char            buf[REG_BUF];
1654 -
1655 -  sprintf(buf, fmt, a, b, c);
1656 -  SeError(buf);
1657 +    SeError(FmtString(fmt, a, b, c));
1658  }
1659  
1660  void
1661  se_warning(msg)
1662 -     char           *msg;
1663 +    char           *msg;
1664  {
1665 -  char            buf[REG_BUF];
1666 +    char            buf[REG_BUF];
1667  
1668 -  sprintf(buf, "\r>> Warning: %s.", msg);
1669 -  show(buf);
1670 +    strncpy(buf, "\r>> Warning: ",REG_BUF);
1671 +    strncat(buf, msg, REG_BUF-14);
1672 +    buf[REG_BUF - 1] = 0; /* Null-terminate to be sure */
1673 +    show(buf);
1674  }
1675  
1676  void
1677  se_warningf(fmt, a, b, c)
1678 -     char           *fmt,
1679 -                    *a,
1680 -                    *b,
1681 -                    *c;
1682 +    char           *fmt,
1683 +    *a,
1684 +    *b,
1685 +    *c;
1686  {
1687 -  char            buf[REG_BUF];
1688 -
1689 -  sprintf(buf, fmt, a, b, c);
1690 -  se_warning(buf);
1691 +    se_warning(FmtString(fmt, a, b, c));
1692  }
1693  
1694  void
1695  SeNotice(msg)
1696 -     char           *msg;
1697 +    char           *msg;
1698  {
1699 -  char            buf[REG_BUF];
1700 +    char            buf[REG_BUF];
1701  
1702 -  sprintf(buf, "\r>> Notice: %s.", msg);
1703 -  show(buf);
1704 +    strncpy(buf, "\r>> Notice: ",REG_BUF);
1705 +    strncat(buf, msg, REG_BUF-13);
1706 +    buf[REG_BUF - 1] = 0; /* Null-terminate to be sure */
1707 +    show(buf);
1708  }
1709  
1710  void
1711  SeNoticeF(fmt, a, b, c)
1712 -     char           *fmt,
1713 -                    *a,
1714 -                    *b,
1715 -                    *c;
1716 +    char           *fmt,
1717 +    *a,
1718 +    *b,
1719 +    *c;
1720  {
1721 -  char            buf[REG_BUF];
1722 -
1723 -  sprintf(buf, fmt, a, b, c);
1724 -  SeNotice(buf);
1725 +    SeNotice(FmtString(fmt, a, b, c));
1726  }
1727  
1728  void
1729  SePError(msg)
1730 -     char           *msg;
1731 +    char           *msg;
1732  {
1733 -  char            buf[REG_BUF];
1734 -
1735 -  sprintf(buf, "%s: %s", msg, strerror(errno));
1736 -  SeError(buf);
1737 +    SeError(FmtString("%s: %s",msg,strerror(errno)));
1738  }
1739  
1740  void
1741  SePErrorF(fmt, a, b, c)
1742 -     char           *fmt,
1743 -                    *a,
1744 -                    *b,
1745 -                    *c;
1746 +    char           *fmt,
1747 +    *a,
1748 +    *b,
1749 +    *c;
1750  {
1751 -  char            buf[REG_BUF];
1752 -
1753 -  sprintf(buf, fmt, a, b, c);
1754 -  SePError(buf);
1755 +    SePError(FmtString(fmt,a,b,c));
1756  }
1757  
1758  /* ------------------------------------------------------------
1759 @@ -180,12 +171,12 @@
1760  int
1761  SeFork()
1762  {
1763 -  pid_t           pid;
1764 +    pid_t           pid;
1765  
1766 -  if ((pid = fork()) < 0)
1767 -    SePError("Faild to fork process");
1768 +    if ((pid = fork()) < 0)
1769 +        SePError("Faild to fork process");
1770  
1771 -  return pid;
1772 +    return pid;
1773  }
1774  
1775  /*
1776 @@ -194,119 +185,119 @@
1777  
1778  void
1779  ShellCommandHandler(sig, fio_p)
1780 -     int             sig;
1781 -     XtPointer       fio_p;
1782 +    int             sig;
1783 +    XtPointer       fio_p;
1784  {
1785 -  void            PostExecPrep();
1786 +    void            PostExecPrep();
1787                  
1788 -  if (wait((int*)0) < 0) SePError("ShellCommand wait failed");
1789 -  XoAppIgnoreSignal(app_con, SIGCHLD);
1790 +    if (wait((int*)0) < 0) SePError("ShellCommand wait failed");
1791 +    XoAppIgnoreSignal(app_con, SIGCHLD);
1792  
1793 -  set_tty_mode();
1794 -  set_modem_fio(*(int *)fio_p);
1795 +    set_tty_mode();
1796 +    set_modem_fio(*(int *)fio_p);
1797  
1798 -  SeyonMessage("Shell Command Completed");
1799 -  PostExecPrep();
1800 -  inhibit_child = False;
1801 +    SeyonMessage("Shell Command Completed");
1802 +    PostExecPrep();
1803 +    inhibit_child = False;
1804  }
1805  
1806  void
1807  ShellCommand(command)
1808 -     char           *command;
1809 +    char           *command;
1810  {
1811 -  ExecShellCommand(command, 1);
1812 +    ExecShellCommand(command, 1);
1813  }
1814  
1815  void
1816  ExecShellCommand(command, top)
1817 -     char           *command;
1818 -        int             top;
1819 +    char           *command;
1820 +    int             top;
1821  {
1822 -  static char    *shell = NULL;
1823 -  char            cmd[REG_BUF],
1824 -                 *scmd;
1825 -  static int      fio=0;
1826 -  pid_t           forkRes;
1827 -
1828 -  if (command == NULL) return;
1829 -
1830 -  if (shell == NULL) {
1831 -    shell = (char*)getenv("SHELL");
1832 -    if (!shell) shell = "/bin/sh";
1833 -  }
1834 -
1835 -  if (top) PreExecPrep();
1836 -
1837 -  io_set_attr(tfd, &oldmode);
1838 -  fio = get_modem_fio();
1839 -
1840 -  if (top)
1841 -       XoAppAddSignal(app_con, SIGCHLD, ShellCommandHandler, (XtPointer)&fio);
1842 -  else signal(SIGCHLD, SIG_IGN);
1843 -
1844 -  forkRes = SeFork();
1845 -  if (forkRes == 0) {
1846 -    scmd = str_stripspc_copy(cmd, command);
1847 -
1848 -    show("");
1849 -
1850 -    if (*scmd == '$') {
1851 -      SeNotice("Redirecting stdin/stdout");
1852 -      mattach();                               /* Attach modem to stdin/stdout */
1853 -      scmd++;
1854 +    static char    *shell = NULL;
1855 +    char            cmd[REG_BUF],
1856 +        *scmd;
1857 +    static int      fio=0;
1858 +    pid_t           forkRes;
1859 +
1860 +    if (command == NULL) return;
1861 +
1862 +    if (shell == NULL) {
1863 +        shell = (char*)getenv("SHELL");
1864 +        if (!shell) shell = "/bin/sh";
1865      }
1866  
1867 -    if (setuid(getuid()) < 0)
1868 -      SePError("Failed to set effective uid");
1869 +    if (top) PreExecPrep();
1870  
1871 -    if (*scmd == CNULL) {
1872 -      SeNotice(FmtString1("Executing the shell `%s'", shell));
1873 -      execl(shell, shell, (char*)NULL);
1874 -      SeError(FmtString1("Execution of the shell `%s' failed", shell));
1875 -      exit(1);
1876 -    }
1877 +    io_set_attr(tfd, &oldmode);
1878 +    fio = get_modem_fio();
1879 +
1880 +    if (top)
1881 +        XoAppAddSignal(app_con, SIGCHLD, ShellCommandHandler, (XtPointer)&fio);
1882 +    else signal(SIGCHLD, SIG_IGN);
1883 +
1884 +    forkRes = SeFork();
1885 +    if (forkRes == 0) {
1886 +        scmd = str_stripspc_copy(cmd, command);
1887 +
1888 +        show("");
1889 +
1890 +        if (*scmd == '$') {
1891 +         SeNotice("Redirecting stdin/stdout");
1892 +         mattach();                            /* Attach modem to stdin/stdout */
1893 +         scmd++;
1894 +        }
1895 +
1896 +        if (setuid(getuid()) < 0)
1897 +         SePError("Failed to set effective uid");
1898 +
1899 +        if (*scmd == CNULL) {
1900 +         SeNotice(FmtString1("Executing the shell `%s'", shell));
1901 +         execl(shell, shell, (char*)NULL);
1902 +         SeError(FmtString1("Execution of the shell `%s' failed", shell));
1903 +         exit(1);
1904 +        }
1905         
1906 -    SeNotice(FmtString1("Executing the command `%s'", scmd));
1907 -    execl(shell, shell, "-c", scmd, (char*)NULL);
1908 -    SePError(FmtString1("Execution of the command `%s' failed", scmd));
1909 -    exit(1);
1910 -  }
1911 -  else if (forkRes > 0) {
1912 -       if (top) inhibit_child = True;
1913 -       else {
1914 +        SeNotice(FmtString1("Executing the command `%s'", scmd));
1915 +        execl(shell, shell, "-c", scmd, (char*)NULL);
1916 +        SePError(FmtString1("Execution of the command `%s' failed", scmd));
1917 +        exit(1);
1918 +    }
1919 +    else if (forkRes > 0) {
1920 +        if (top) inhibit_child = True;
1921 +        else {
1922           wait((int*)0);                        /* Wait for the child process to terminate */
1923           set_tty_mode();
1924           set_modem_fio(fio);
1925 -       }
1926 -  }  /* if (forkRes == 0)... */
1927 +        }
1928 +    }  /* if (forkRes == 0)... */
1929  }
1930  
1931  void
1932  PreProcessPrep()
1933  {
1934 -  SuspContTerminal(TERM_SUSPEND);
1935 -  SetKillButtonSens(True);
1936 +    SuspContTerminal(TERM_SUSPEND);
1937 +    SetKillButtonSens(True);
1938  }
1939  
1940  void
1941  PostProcessPrep()
1942  {
1943 -  SuspContTerminal(TERM_CONTINUE);
1944 -  SetKillButtonSens(False);
1945 +    SuspContTerminal(TERM_CONTINUE);
1946 +    SetKillButtonSens(False);
1947  }
1948  
1949  void
1950  PreExecPrep()
1951  {
1952 -  SuspContTerminal(0);
1953 -  w_exit_up(False);
1954 +    SuspContTerminal(0);
1955 +    w_exit_up(False);
1956  }
1957  
1958  void
1959  PostExecPrep()
1960  {
1961 -  SuspContTerminal(1);
1962 -  w_exit_up(True);
1963 +    SuspContTerminal(1);
1964 +    w_exit_up(True);
1965  }
1966  
1967  /*
1968 @@ -318,33 +309,34 @@
1969   */
1970  
1971  char           *
1972 -expand_fname(fname, buffer)
1973 -     char           *fname,
1974 -                    *buffer;
1975 -{
1976 -  char           *home,
1977 -                 *buf,
1978 -                  name[REG_BUF];
1979 -  int             i;
1980 -
1981 -  str_stripspc_copy(name, fname);
1982 -  buf = buffer;
1983 -
1984 -  for (i = 0; name[i]; i++) {
1985 -    if (name[i] == '~') {
1986 -      if ((home = (char *) getenv("HOME")) == NULL)
1987 -       return NULL;
1988 -      strcpy(buf, home);
1989 -      buf += strlen(home);
1990 +expand_fname(fname, buffer, size)
1991 +    char           *fname,
1992 +    *buffer;
1993 +    int             size;
1994 +{
1995 +    char           *home,
1996 +        *buf,
1997 +        name[REG_BUF];
1998 +    int             i;
1999 +
2000 +    str_stripspc_copy(name, fname);
2001 +    buf = buffer;
2002 +
2003 +    for (i = 0; (name[i] && (buffer+REG_BUF > buf)); i++) {
2004 +        if (name[i] == '~') {
2005 +         if ((home = (char *) getenv("HOME")) == NULL)
2006 +             return NULL;
2007 +         strncpy(buf, home, size);
2008 +         buf += strlen(home);
2009 +        }
2010 +        else {
2011 +         *buf = name[i];
2012 +         buf++;
2013 +        }
2014      }
2015 -    else {
2016 -      *buf = name[i];
2017 -      buf++;
2018 -    }
2019 -  }
2020 -  *buf = '\0';
2021 +    *buf = '\0';
2022  
2023 -  return buffer;
2024 +    return buffer;
2025  }
2026  
2027  /*
2028 @@ -353,11 +345,12 @@
2029   */
2030  
2031  FILE*
2032 -open_file(fname, directory)
2033 -     char           *fname,
2034 -                    *directory;
2035 +open_file(fname, size, directory)
2036 +    char           *fname;
2037 +    int             size;
2038 +    char           *directory;
2039  {
2040 -  return open_file_va(fname, directory, NULL);
2041 +    return open_file_va(fname, size, directory, NULL);
2042  }
2043  
2044  /*
2045 @@ -365,120 +358,79 @@
2046   */
2047  
2048  FILE*
2049 -open_file_va(fname, dir1, dir2)
2050 -     char           *fname,
2051 -                    *dir1,
2052 -                    *dir2;
2053 -{
2054 -  FILE           *fp;
2055 -  char            name[REG_BUF],
2056 -                  fullname[REG_BUF],
2057 -                  buffer[REG_BUF];
2058 -
2059 -  str_stripspc_copy(name, fname);
2060 -
2061 -  if (dir1) {
2062 -    sprintf(fullname, "%s/%s", expand_fname(dir1, buffer), name);
2063 -
2064 -    if ((fp = fopen(fullname, "r")) != NULL) {
2065 -      strcpy(fname, fullname);
2066 -      return fp;
2067 -    }
2068 -
2069 -    if (dir2) {
2070 -      sprintf(fullname, "%s/%s", expand_fname(dir2, buffer), name);
2071 +open_file_va(fname, size, dir1, dir2)
2072 +    char           *fname;
2073 +    int             size;
2074 +    char           *dir1,
2075 +                   *dir2;
2076 +{
2077 +    FILE           *fp;
2078 +    char           *fullname,
2079 +        name[REG_BUF],
2080 +        buffer[REG_BUF];
2081 +
2082 +    str_stripspc_copy(name, fname);
2083 +
2084 +    if (dir1) {
2085 +        fullname = FmtString("%s/%s", expand_fname(dir1, buffer, REG_BUF), name, "");
2086 +        if ((fp = fopen(fullname, "r")) != NULL) {
2087 +         strncpy(fname, fullname, size);
2088 +         return fp;
2089 +        }
2090  
2091 -      if ((fp = fopen(fullname, "r")) != NULL) {
2092 -               strcpy(fname, fullname);
2093 -               return fp;
2094 -      }
2095 +        if (dir2) {
2096 +         fullname = FmtString("%s/%s", expand_fname(dir2, buffer, REG_BUF), name, "");
2097 +         if ((fp = fopen(fullname, "r")) != NULL) {
2098 +             strncpy(fname, fullname, size);
2099 +             return fp;
2100 +         }
2101 +        }
2102 +    }  /* if (dir1)... */
2103 +
2104 +    if ((fp = fopen(name, "r")) != NULL) {
2105 +        strncpy(fname, name, REG_BUF);
2106 +        return fp;
2107      }
2108 -  }    /* if (dir1)... */
2109 -
2110 -  if ((fp = fopen(name, "r")) != NULL) {
2111 -    strcpy(fname, name);
2112 -    return fp;
2113 -  }
2114  
2115 -  SeErrorF("/OFV/ Could not open the file `%s'", name, "", "");
2116 -  if (dir1) {
2117 -    SeNoticeF("Tried the default directory `%s'", dir1, "", "");
2118 -    if (dir2)
2119 -      SeNoticeF("Tried the default directory `%s'", dir2, "", "");
2120 -  }
2121 -  SeNotice("Tried the current directory");
2122 +    SeErrorF("/OFV/ Could not open the file `%s'", name, "", "");
2123 +    if (dir1) {
2124 +        SeNoticeF("Tried the default directory `%s'", dir1, "", "");
2125 +        if (dir2)
2126 +         SeNoticeF("Tried the default directory `%s'", dir2, "", "");
2127 +    }
2128 +    SeNotice("Tried the current directory");
2129  
2130 -  return NULL;
2131 +    return NULL;
2132  }
2133  
2134  /*
2135 - * another implementation of the above using varargs, currently not used
2136 - */
2137 -
2138 -/*FILE *open_file_va(args)
2139 -        va_list args;
2140 -        va_decl
2141 -{
2142 -  FILE *fp;
2143 -  char *name, *dir, fullname[REG_BUF];
2144 -  char buffer[REG_BUF];
2145 -
2146 -  va_start(args);
2147 -  name = va_arg(args, char *);
2148 -
2149 -  if (fp = fopen(name, "r"))
2150 -       return fp;
2151 -
2152 -  while(dir = va_arg(args, char *))
2153 -       {
2154 -         sprintf(fullname, "%s/%s", expand_fname(SSpc(dir), buffer), name);
2155 -
2156 -         if (fp = fopen(fullname, "r"))
2157 -               return fp;
2158 -       }
2159 -
2160 -  va_end(args);
2161 -
2162 -  if (dir = (char *) getenv("HOME")) {
2163 -       sprintf(fullname, "%s/%s", dir, name);
2164 -       
2165 -       if (fp = fopen(fullname, "r"))
2166 -         return fp;
2167 -  }
2168 -
2169 -  showf("<< Seyon: file '%s' not in current, default, or home directory >>",
2170 -               name, "", "");
2171 -  return NULL;
2172 -}*/
2173 -
2174 -/*
2175   * read a file into a buffer
2176   */
2177  
2178  void
2179  read_file(fp, line)
2180 -     FILE           *fp;
2181 -     char           *line[];
2182 +    FILE           *fp;
2183 +    char           *line[];
2184  {
2185 -  char            buffer[REG_BUF + 1];
2186 -  int             i;
2187 +    char            buffer[REG_BUF + 1];
2188 +    int             i;
2189  
2190 -  for (i = 0; i < MAX_ENT && fgets(buffer, REG_BUF, fp) != NULL; i++)
2191 -    line[i] = strcpy((char *)malloc(sizeof(buffer)), SSpc(buffer));
2192 -  line[i] = NULL;
2193 +    for (i = 0; i < MAX_ENT && fgets(buffer, REG_BUF, fp) != NULL; i++)
2194 +        line[i] = strcpy((char *)malloc(sizeof(buffer)), SSpc(buffer));
2195 +    line[i] = NULL;
2196  }
2197  
2198  /*
2199 - * similar to the above, but closes the file after readsing it
2200 + * similar to the above, but closes the file after reading it
2201   */
2202  
2203  void
2204  read_close_file(fp, line)
2205 -     FILE           *fp;
2206 -     char           *line[];
2207 +    FILE           *fp;
2208 +    char           *line[];
2209  {
2210 -  read_file(fp, line);
2211 -  fclose(fp);
2212 +    read_file(fp, line);
2213 +    fclose(fp);
2214  }
2215  
2216  /*
2217 @@ -487,12 +439,12 @@
2218  
2219  void
2220  write_pipe_data(pd, data, size)
2221 -     int            *pd;
2222 -     char           *data;
2223 -     int             size;
2224 +    int            *pd;
2225 +    char           *data;
2226 +    int             size;
2227  {
2228 -  if (write(pd[1], data, size) < 0)
2229 -    show("<< Could not write to pipe >>");
2230 +    if (write(pd[1], data, size) < 0)
2231 +        show("<< Could not write to pipe >>");
2232  }
2233  
2234  /*
2235 @@ -501,11 +453,11 @@
2236  
2237  void
2238  read_pipe_data(pd, data, size)
2239 -     int            *pd;
2240 -     char           *data;
2241 -     int             size;
2242 +    int            *pd;
2243 +    char           *data;
2244 +    int             size;
2245  {
2246 -  read(pd[0], data, size);
2247 +    read(pd[0], data, size);
2248  }
2249  
2250  /*
2251 @@ -515,30 +467,30 @@
2252  void
2253  IdleGuard()
2254  {
2255 -  struct stat     statBuf;
2256 -  time_t          idleTime;
2257 -  static time_t   totalIdleTime;
2258 -  int             timeToNextCall;
2259 -
2260 -  if (qres.idleGuard && !inhibit_child) {
2261 -    if (fstat(tfd, &statBuf) < 0) {
2262 -      SePError("/IG/ Could not stat the tty");
2263 -      return;
2264 -    }
2265 +    struct stat     statBuf;
2266 +    time_t          idleTime;
2267 +    static time_t   totalIdleTime;
2268 +    int             timeToNextCall;
2269 +
2270 +    if (qres.idleGuard && !inhibit_child) {
2271 +        if (fstat(tfd, &statBuf) < 0) {
2272 +         SePError("/IG/ Could not stat the tty");
2273 +         return;
2274 +        }
2275 +
2276 +        if ((idleTime = time((time_t *) 0) - statBuf.st_mtime) >=
2277 +         qres.idleGuardInterval * 0.99) {
2278 +         MdmPutString(qres.idleGuardString);
2279 +         timeToNextCall = qres.idleGuardInterval;
2280 +         totalIdleTime += idleTime;
2281 +         SeyonMessagef("Idle for %d minutes", (totalIdleTime + 30) / 60);
2282 +        }
2283 +        else {
2284 +         timeToNextCall = qres.idleGuardInterval - (int)idleTime;
2285 +         totalIdleTime = 0;
2286 +        }
2287  
2288 -    if ((idleTime = time((time_t *) 0) - statBuf.st_mtime) >=
2289 -       qres.idleGuardInterval * 0.99) {
2290 -      MdmPutString(qres.idleGuardString);
2291 -      timeToNextCall = qres.idleGuardInterval;
2292 -      totalIdleTime += idleTime;
2293 -      SeyonMessagef("Idle for %d minutes", (totalIdleTime + 30) / 60);
2294 -    }
2295 -    else {
2296 -      timeToNextCall = qres.idleGuardInterval - (int)idleTime;
2297 -      totalIdleTime = 0;
2298 -    }
2299 -
2300 -    XtAppAddTimeOut(app_con, timeToNextCall * 1000,
2301 +        XtAppAddTimeOut(app_con, timeToNextCall * 1000,
2302                     (XtTimerCallbackProc) IdleGuard, (XtPointer) app_con);
2303 -  }
2304 +    }
2305  }
2306 --- seyon-2.20c.orig/Seyon.c
2307 +++ seyon-2.20c/Seyon.c
2308 @@ -72,314 +72,365 @@
2309  pid_t           mainPid;
2310  
2311  int
2312 -main(argc, argv)
2313 -     int             argc;
2314 -     char           *argv[];
2315 +main(int argc, char *argv[])
2316  {
2317 -  int             OpenModem();
2318 -  void            DispatchActions(),
2319 -                  GetParameters(),
2320 -                  ShowOpenModemErrMsg();
2321 -
2322 -  char           *arg[REG_BUF], termEmu[REG_BUF];
2323 -  int             sepIndex, i, n, retStatus;
2324 +    int             OpenModem();
2325 +    void            DispatchActions(),
2326 +                    GetParameters(),
2327 +                    ShowOpenModemErrMsg();
2328 +
2329 +    char           *arg[REG_BUF], 
2330 +                    termEmu[REG_BUF];
2331 +    int             sepIndex,
2332 +                    i, 
2333 +                    n, 
2334 +                    length,
2335 +                    retStatus;
2336  #ifdef HAVE_FAS
2337 -  char            large_string[1024];
2338 +    char            large_string[LRG_BUF];
2339  #endif
2340  
2341 -  XtAppContext    appContext;
2342 -  char            modemList[LRG_BUF], 
2343 -                 *curModem, 
2344 -                 *startupAction = modemList;
2345 +    int             length_remaining;
2346 +    XtAppContext    appContext;
2347 +    char            modemList[LRG_BUF], 
2348 +                   *curModem, 
2349 +                   *startupAction = modemList;
2350  
2351 -  static char    *fallbackResources[] = {
2352 +    static char    *fallbackResources[] = {
2353  #include "Seyon.ad.h"
2354 -    NULL,
2355 -  };
2356 +        NULL,
2357 +    };
2358  
2359 -  static XrmOptionDescRec optionList[] =  {
2360 -    {"-modems", "modems", XrmoptionSepArg, NULL},
2361 -    {"-script", "script", XrmoptionSepArg, NULL},
2362 -    {"-entries", "defaultPhoneEntries", XrmoptionSepArg, NULL},
2363 -    {"-dial", "dialAutoStart", XrmoptionNoArg, "True"},
2364 -    {"-nodial", "dialAutoStart", XrmoptionNoArg, "False"},
2365 -    {"-emulator", "emulator", XrmoptionSepArg, ""},
2366 -    {"-noemulator", "noemulator", XrmoptionNoArg, ""},
2367 -    {"-nodefargs", "nodefargs", XrmoptionNoArg, ""},
2368 -  };
2369 +    static XrmOptionDescRec optionList[] =  {
2370 +        {"-modems", "modems", XrmoptionSepArg, NULL},
2371 +        {"-script", "script", XrmoptionSepArg, NULL},
2372 +        {"-entries", "defaultPhoneEntries", XrmoptionSepArg, NULL},
2373 +        {"-dial", "dialAutoStart", XrmoptionNoArg, "True"},
2374 +        {"-nodial", "dialAutoStart", XrmoptionNoArg, "False"},
2375 +        {"-emulator", "emulator", XrmoptionSepArg, ""},
2376 +        {"-noemulator", "noemulator", XrmoptionNoArg, ""},
2377 +        {"-nodefargs", "nodefargs", XrmoptionNoArg, ""},
2378 +    };
2379    
2380 -  for (i = 1; i < argc && strcmp(argv[i], "--"); i++);
2381 -  sepIndex = i;
2382 +    for (i = 1; i < argc && strcmp(argv[i], "--"); i++);
2383 +    sepIndex = i;
2384  
2385 -  /* Find if the -noemulator switch is given */
2386 -  for (i = 1; i < sepIndex && 
2387 +    /* Find if the -noemulator switch is given */
2388 +    for (i = 1; i < sepIndex && 
2389            strncmp(argv[i], "-noemulator", max(4, strlen(argv[i]))); i++);
2390  
2391 -  /* If no, launch Seyon via the emulator */
2392 -  if (i >= sepIndex) {
2393 +    /* If no, launch Seyon via the emulator */
2394 +    if (i >= sepIndex) {
2395  
2396 -       for (i = 1; i < sepIndex &&
2397 -                strncmp(argv[i], "-emulator", max(3, strlen(argv[i]))); i++);
2398 -       if (i < sepIndex - 1)
2399 -         strcpy(termEmu, argv[i+1]);
2400 -       else
2401 -         strcpy(termEmu, SEYON_EMU_NAME);
2402 -
2403 -       /* Find if the -nodefargs switch is given */
2404 -       for (i = 1; i < sepIndex && 
2405 -                strncmp(argv[i], "-nodefargs", max(5, strlen(argv[i]))); i++);
2406 +        for (i = 1; i < sepIndex &&
2407 +              strncmp(argv[i], "-emulator", max(3, strlen(argv[i]))); i++);
2408 +        if (i < sepIndex - 1)
2409 +         strncpy(termEmu, argv[i+1], REG_BUF);
2410 +        else
2411 +         strncpy(termEmu, SEYON_EMU_NAME, REG_BUF);
2412 +
2413 +        /* Find if the -nodefargs switch is given */
2414 +        for (i = 1; i < sepIndex && 
2415 +              strncmp(argv[i], "-nodefargs", max(5, strlen(argv[i]))); i++);
2416  
2417 -       n = 1;
2418 +        n = 1;
2419  
2420 -       /* If no, use the default emulator arguments */
2421 -       if (i >= sepIndex) {
2422 +        /* If no, use the default emulator arguments */
2423 +        if (i >= sepIndex) {
2424           arg[n] = "-name"; n++;
2425           arg[n] = "Seyon"; n++;
2426           arg[n] = "-T"; n++;
2427           arg[n] = "Seyon Terminal Emulator"; n++;
2428           arg[n] = "-n"; n++;
2429           arg[n] = "Terminal"; n++;
2430 -       }
2431 +        }
2432  
2433 -       /* Pass all switches aftetr '--' to the emulator */
2434 -       for (i = sepIndex + 1; i < argc; i++, n++)
2435 +        /* Pass all switches aftetr '--' to the emulator */
2436 +        for (i = sepIndex + 1; i < argc; i++, n++)
2437           arg[n] = argv[i];
2438         
2439 -       arg[n] = "-e"; n++;
2440 +        arg[n] = "-e"; n++;
2441  
2442  #ifndef HAVE_FAS
2443 -       arg[n] = argv[0]; n++;
2444 -       arg[n] = "-noemulator"; n++;
2445 +        arg[n] = argv[0]; n++;
2446 +        arg[n] = "-noemulator"; n++;
2447  
2448 -       /* Pass all switches before '--' to Seyon */
2449 -       for (i = 1; i < sepIndex; i++, n++)
2450 +        /* Pass all switches before '--' to Seyon */
2451 +        for (i = 1; i < sepIndex; i++, n++)
2452           arg[n] = argv[i];
2453  #else
2454 -       arg[n] = "/bin/sh";     n++;
2455 -       arg[n] = "-c"; n++;
2456 -       arg[n] = large_string;
2457 -       strcpy(arg[n], argv[0]);
2458 -       strcat(arg[n], " -noemulator");
2459 -       for (i = 1; i < sepIndex; i++) {
2460 -         strcat(arg[n]," ");
2461 -         strcat(arg[n],argv[i]);
2462 -       }
2463 -       n++;
2464 +        arg[n] = "/bin/sh";    n++;
2465 +        arg[n] = "-c"; n++;
2466 +        arg[n] = large_string;
2467 +        length_remaining = LRG_BUF;
2468 +        strncpy(arg[n], argv[0], LRG_BUF);
2469 +        length_remaining -= strlen(argv[0]);
2470 +        length = strlen(" -noemulator");
2471 +        if(length_remaining > length)
2472 +        {
2473 +         strncat(arg[n], " -noemulator", length_remaining);
2474 +         length_remaining -= length;
2475 +        }
2476 +        else
2477 +        {
2478 +         printf("String overflow in parsing options\n");
2479 +         exit (1);
2480 +        }        
2481 +        for (i = 1; i < sepIndex; i++) {
2482 +         length = strlen(argv[i]) + 1;
2483 +         if(length_remaining > length)
2484 +         {
2485 +             strncat(arg[n]," ", 1);
2486 +             strncat(arg[n],argv[i], length_remaining);
2487 +         }
2488 +         else
2489 +         {
2490 +             printf("String overflow in parsing options\n");
2491 +             exit (1);
2492 +         }
2493 +        }
2494 +        n++;
2495  #endif
2496  
2497 -       arg[n] = NULL; n++;
2498 +        arg[n] = NULL; n++;
2499  
2500 -       arg[0] = termEmu;
2501 -       execvp(arg[0], arg);
2502 +        arg[0] = termEmu;
2503 +        execvp(arg[0], arg);
2504  
2505 -       fprintf(stderr, "%s `%s.\n%s\n", ">> Warning: Could not execute", 
2506 -                       termEmu, ">> Notice: Falling to `xterm'.");
2507 +        fprintf(stderr, "%s `%s.\n%s\n", ">> Warning: Could not execute", 
2508 +             termEmu, ">> Notice: Falling to `xterm'.");
2509  
2510 -       arg[0] = "xterm";
2511 -       execvp(arg[0], arg);
2512 +        arg[0] = "xterm";
2513 +        execvp(arg[0], arg);
2514         
2515 -       fprintf(stderr, "%s\n%s\n", ">> Error: Could not execute `xterm'.",
2516 -                       ">> Notice: Giving up.");
2517 -       exit(1);
2518 -  }  /* if (i >= sepIndex)... */
2519 -
2520 -  /* ---------------------------------------------------------------------- */
2521 -  /* ---------------------------------------------------------------------- */
2522 -
2523 -  /* The real program begins here */
2524 -
2525 -  topLevel = XtAppInitialize(&appContext, "Seyon", optionList,
2526 -                                                        XtNumber(optionList), &argc, argv,
2527 -                                                        fallbackResources, NULL, 0);
2528 -  app_con = appContext;
2529 -  GetResources(topLevel);
2530 -
2531 -  mainPid = getpid();
2532 -  setup_signal_handlers();
2533 -  SetIcon(topLevel);
2534 -
2535 -  printf("\r\n%s %s\r\n", "Seyon Copyright (c) 1992-1993 Muhammad M. Saggaf.",
2536 -                "All rights reserved.");
2537 -  printf("\rVersion %s rev. %s %s-%s %s@%s %s %s.\r\n\n", VERSION, REVISION, 
2538 -                COMPILE_HOSTTYPE, COMPILE_OSNAME, COMPILE_BY, COMPILE_HOST,
2539 -                COMPILE_DATE, COMPILE_TIME);
2540 -
2541 -  if ((tfp = fopen("/dev/tty", "r+")) == NULL) {
2542 -    PopupInitError("errTtyAccess", exit);
2543 -    goto MainLoop;
2544 -  }
2545 +        fprintf(stderr, "%s\n%s\n", ">> Error: Could not execute `xterm'.",
2546 +             ">> Notice: Giving up.");
2547 +        exit(1);
2548 +    }  /* if (i >= sepIndex)... */
2549 +
2550 +    /* ------------------------------------------------------------------ */
2551 +    /* ------------------------------------------------------------------ */
2552 +
2553 +    /* The real program begins here */
2554 +
2555 +    topLevel = XtAppInitialize(&appContext, "Seyon", optionList,
2556 +                        XtNumber(optionList), &argc, argv,
2557 +                        fallbackResources, NULL, 0);
2558 +    app_con = appContext;
2559 +    GetResources(topLevel);
2560 +
2561 +    mainPid = getpid();
2562 +    setup_signal_handlers();
2563 +    SetIcon(topLevel);
2564 +
2565 +    printf("\r\n%s %s\r\n", "Seyon Copyright (c) 1992-1993 Muhammad M. Saggaf.",
2566 +        "All rights reserved.");
2567 +    printf("\rVersion %s rev. %s %s-%s %s@%s %s %s.\r\n\n", VERSION, REVISION, 
2568 +        COMPILE_HOSTTYPE, COMPILE_OSNAME, COMPILE_BY, COMPILE_HOST,
2569 +        COMPILE_DATE, COMPILE_TIME);
2570 +
2571 +    if ((tfp = fopen("/dev/tty", "r+")) == NULL) {
2572 +        PopupInitError("errTtyAccess", exit);
2573 +        goto MainLoop;
2574 +    }
2575  
2576 -  tfd = fileno(tfp);
2577 +    tfd = fileno(tfp);
2578  
2579 -  io_get_attr(tfd, &oldmode);  /* get current console tty mode */
2580 -  newmode = oldmode;          /* copy (structure) to newmode  */
2581 +    io_get_attr(tfd, &oldmode);  /* get current console tty mode       */
2582 +    newmode = oldmode;        /* copy (structure) to newmode  */
2583  
2584  #if HAVE_TERMIOS || HAVE_TERMIO
2585 -  newmode.c_oflag &= ~OPOST;
2586 -  newmode.c_iflag |= (IGNBRK | IGNPAR);
2587 -  newmode.c_iflag &= ~(IXON | IXOFF | ISTRIP | BRKINT);
2588 -  newmode.c_lflag &= ~(ICANON | ISIG | ECHO);
2589 -  newmode.c_cflag |= CREAD;
2590 -  newmode.c_cc[VMIN] = 1;
2591 -  newmode.c_cc[VTIME] = 1;
2592 +    newmode.c_oflag &= ~OPOST;
2593 +    newmode.c_iflag |= (IGNBRK | IGNPAR);
2594 +    newmode.c_iflag &= ~(IXON | IXOFF | ISTRIP | BRKINT);
2595 +    newmode.c_lflag &= ~(ICANON | ISIG | ECHO);
2596 +    newmode.c_cflag |= CREAD;
2597 +    newmode.c_cc[VMIN] = 1;
2598 +    newmode.c_cc[VTIME] = 1;
2599  #else
2600  #if HAVE_SGTTYB
2601 -  newmode.sg_flags = CBREAK;
2602 +    newmode.sg_flags = CBREAK;
2603  #endif
2604  #endif
2605  
2606 -  set_tty_mode();
2607 +    set_tty_mode();
2608  
2609 -  InitVariables(topLevel);
2610 +    InitVariables(topLevel);
2611  
2612 -  if (argc > 1 && strcmp(argv[1], "--")) {
2613 -       SeErrorF("Unknown or incomplete command-line switch: `%s'", argv[1], 
2614 -                        "", "");
2615 -    PopupInitError("errSwitches", do_exit);
2616 -    goto MainLoop;
2617 -  }
2618 +    if (argc > 1 && strcmp(argv[1], "--")) {
2619 +        SeErrorF("Unknown or incomplete command-line switch: `%s'", argv[1], 
2620 +              "", "");
2621 +        PopupInitError("errSwitches", do_exit);
2622 +        goto MainLoop;
2623 +    }
2624  
2625 -  /* ---------------------------------------------------------------------- */
2626 +    /* ------------------------------------------------------------------- */
2627  
2628 -  /* Open modem port and configure it */
2629 +    /* Open modem port and configure it */
2630  
2631 -  strcpy(modemList, qres.modems);
2632 -  curModem = GetFirstWord(modemList);
2633 +    strncpy(modemList, qres.modems, LRG_BUF);
2634 +    curModem = GetFirstWord(modemList);
2635  
2636 -  show("Locating Modems...");
2637 +    show("Locating Modems...");
2638  
2639 -  do {
2640 -       if ((retStatus = OpenModem(curModem)) >= 0) break;
2641 +    do {
2642 +        if ((retStatus = OpenModem(curModem)) >= 0) break;
2643  
2644 -       ShowOpenModemErrMsg(curModem, retStatus);
2645 -       if (retStatus != ERR_MDM_NOMODEM)
2646 +        ShowOpenModemErrMsg(curModem, retStatus);
2647 +        if (retStatus != ERR_MDM_NOMODEM)
2648           show(FmtString("Modem `%s' is Unavailable.\n", curModem, "", ""));
2649 -       curModem = GetNextWord();
2650 -  } while (curModem[0] != '\0');
2651 -
2652 -  if (retStatus < 0) {
2653 -       SeError("No Modems Available");
2654 -       PopupInitError("errModemInit", do_exit); 
2655 -       goto MainLoop;
2656 -  }
2657 -
2658 -  show(FmtString("Modem `%s' is Available.\n", curModem, "", ""));
2659 -
2660 -  /* ---------------------------------------------------------------------- */
2661 -
2662 -  CreateCommandCenter();
2663 -
2664 -  /* ---------------------------------------------------------------------- */
2665 +        curModem = GetNextWord();
2666 +    } while (curModem[0] != '\0');
2667  
2668 -  pipe(child_pipe);
2669 -  pipe(scriptToMainPipe);
2670 -  pipe(mainToTermPipe);
2671 -  XtAppAddInput(appContext, child_pipe[0], (XtPointer)XtInputReadMask, 
2672 -                               ExecProcRequest, NULL);
2673 -  XtAppAddInput(appContext, scriptToMainPipe[0], (XtPointer)XtInputReadMask, 
2674 -                               GetParameters, NULL);
2675 +    if (retStatus < 0) {
2676 +        SeError("No Modems Available");
2677 +        PopupInitError("errModemInit", do_exit); 
2678 +        goto MainLoop;
2679 +    }
2680 +
2681 +    show(FmtString("Modem `%s' is Available.\n", curModem, "", ""));
2682 +
2683 +    /* ------------------------------------------------------------------- */
2684 +
2685 +    CreateCommandCenter();
2686 +
2687 +    /* ------------------------------------------------------------------- */
2688 +
2689 +    pipe(child_pipe);
2690 +    pipe(scriptToMainPipe);
2691 +    pipe(mainToTermPipe);
2692 +    XtAppAddInput(appContext, child_pipe[0], (XtPointer)XtInputReadMask, 
2693 +               ExecProcRequest, NULL);
2694 +    XtAppAddInput(appContext, scriptToMainPipe[0], (XtPointer)XtInputReadMask, 
2695 +               GetParameters, NULL);
2696 +
2697 +    IdleGuard();
2698 +    if (qres.showFunMessages) 
2699 +        XtAppAddTimeOut(appContext, qres.funMessagesInterval*1000, 
2700 +                   FunMessage, NULL);
2701 +
2702 +    /* ------------------------------------------------------------------- */
2703 +
2704 +    length_remaining = LRG_BUF;
2705 +    strncpy(startupAction, qres.startupAction, LRG_BUF);
2706 +    length_remaining -= strlen(startupAction);
2707 +    if (qres.script) 
2708 +    {
2709 +        length = strlen(" RunScript();") + strlen(qres.script);
2710 +        if (length_remaining > length)
2711 +        {
2712 +         sprintf(startupAction + strlen(startupAction), 
2713 +               " RunScript(%s);", qres.script);
2714 +         length_remaining -= length;
2715 +        }
2716 +        else
2717 +        {
2718 +         printf("String overflow in parsing options\n");
2719 +         exit (1);
2720 +        }
2721 +    }
2722 +    if (qres.dialAutoStart) 
2723 +    {
2724 +        length = strlen(" DialEntries(Default);");
2725 +        if(length_remaining > length)
2726 +        {
2727 +         strncat(startupAction, " DialEntries(Default);", length);
2728 +         length -= length;
2729 +        }
2730 +        else
2731 +        {
2732 +         printf("String overflow in parsing options\n");
2733 +         exit (1);
2734 +        }
2735 +    }  
2736 +
2737 +    /* ------------------------------------------------------------------- */
2738  
2739 -  IdleGuard();
2740 -  if (qres.showFunMessages) XtAppAddTimeOut(appContext, 
2741 -                                                   qres.funMessagesInterval*1000, FunMessage, NULL);
2742 +    linkflag = 2;
2743 +    ProcRequest(DISPATCH_ACTION, "", startupAction);
2744  
2745 -  /* ---------------------------------------------------------------------- */
2746 +    /* ------------------------------------------------------------------- */
2747  
2748 -  strcpy(startupAction, qres.startupAction);
2749 -  if (qres.script) sprintf(startupAction + strlen(startupAction), 
2750 -                                                  " RunScript(%s);", qres.script);
2751 -  if (qres.dialAutoStart) strcat(startupAction, " DialEntries(Default);");
2752 -
2753 -  /* ---------------------------------------------------------------------- */
2754 -
2755 -  linkflag = 2;
2756 -  ProcRequest(DISPATCH_ACTION, "", startupAction);
2757 -
2758 -  /* ---------------------------------------------------------------------- */
2759 -
2760 -  XtSetMappedWhenManaged(topLevel, True);
2761 -  XtMapWidget(topLevel);               /* I don't know why I need this, but I do */
2762 +    XtSetMappedWhenManaged(topLevel, True);
2763 +    XtMapWidget(topLevel);             /* I don't know why I need this, but I do */
2764  
2765  MainLoop:
2766 -  XtAppMainLoop(app_con);
2767 -  return 0;
2768 +    XtAppMainLoop(app_con);
2769 +    return 0;
2770  }
2771  
2772  void
2773 -setup_signal_handlers()
2774 +setup_signal_handlers(void)
2775  {
2776 -  signal(SIGINT, SIG_IGN);
2777 -  signal(SIGQUIT, SIG_IGN);
2778 +    signal(SIGINT, SIG_IGN);
2779 +    signal(SIGQUIT, SIG_IGN);
2780  
2781  #ifdef SIGBUS
2782 -  signal(SIGBUS, die);
2783 +    signal(SIGBUS, die);
2784  #endif
2785 -  signal(SIGFPE, die);
2786 -  signal(SIGILL, die);
2787 -  signal(SIGIOT, die);
2788 -  signal(SIGSEGV, die);
2789 -  signal(SIGTERM, die);
2790 -  signal(SIGTRAP, die);
2791 +    signal(SIGFPE, die);
2792 +    signal(SIGILL, die);
2793 +    signal(SIGIOT, die);
2794 +    signal(SIGSEGV, die);
2795 +    signal(SIGTERM, die);
2796 +    signal(SIGTRAP, die);
2797  }
2798  
2799  void
2800 -die(sig)
2801 -     int             sig;
2802 +die(int sig)
2803  {
2804 -  void                   KillChildProc();
2805 -  signal(sig, SIG_IGN);
2806 +    void                 KillChildProc();
2807 +    signal(sig, SIG_IGN);
2808  
2809 -  SeErrorF("Killed by signal %d", sig, "", "");
2810 -  SeNoticeF("Debugging info: pid=%d.", getpid(), "", "");
2811 +    SeErrorF("Killed by signal %d", sig, "", "");
2812 +    SeNoticeF("Debugging info: pid=%d.", getpid(), "", "");
2813  
2814 -  if (getpid() == mainPid) {
2815 -    KillTerminal();
2816 -       KillChildProc();
2817 +    if (getpid() == mainPid) {
2818 +        KillTerminal();
2819 +        KillChildProc();
2820         
2821 -       SeNotice("Press any key to exit");
2822 -       getchar();
2823 -       cleanup_exit(1);
2824 -  }
2825 -  else {
2826 -    write_child_info(child_pipe, KILL_TERM, "Terminal Proc Exited");
2827 -       exit(1);
2828 -  }
2829 +        SeNotice("Press any key to exit");
2830 +        getchar();
2831 +        cleanup_exit(1);
2832 +    }
2833 +    else {
2834 +        write_child_info(child_pipe, KILL_TERM, "Terminal Proc Exited");
2835 +        exit(1);
2836 +    }
2837  }
2838  
2839  void
2840 -do_exit(rc)
2841 -     int             rc;
2842 +do_exit(int rc)
2843  {
2844 -  void                   KillChildProc();
2845 +    void                 KillChildProc();
2846  
2847 -  XtUnmapWidget(topLevel);
2848 -  KillTerminal();
2849 -  KillChildProc();
2850 +    XtUnmapWidget(topLevel);
2851 +    KillTerminal();
2852 +    KillChildProc();
2853  
2854 -  unlock_tty();
2855 +    unlock_tty();
2856  
2857 -  fflush(tfp);
2858 -  restore_orig_mode();
2859 -  fclose(tfp);
2860 +    fflush(tfp);
2861 +    restore_orig_mode();
2862 +    fclose(tfp);
2863  
2864 -  CloseModem();
2865 +    CloseModem();
2866  
2867 -  XtDestroyApplicationContext(XtWidgetToApplicationContext(topLevel));
2868 +    XtDestroyApplicationContext(XtWidgetToApplicationContext(topLevel));
2869  /*  XCloseDisplay(XtDisplay(topLevel));*/
2870 -  exit(rc);
2871 +    exit(rc);
2872  }
2873  
2874  void
2875 -cleanup_exit(status)
2876 -     int             status;
2877 +cleanup_exit(int status)
2878  {
2879 -  SeNotice("cleaning up..");
2880 -  do_exit(status);
2881 +    SeNotice("cleaning up..");
2882 +    do_exit(status);
2883  }
2884  
2885  void
2886  s_exit()
2887  {
2888 -  show("I'm rated PG-34!!");
2889 -  do_exit(0);
2890 +    show("I'm rated PG-34!!");
2891 +    do_exit(0);
2892  }
2893 --- seyon-2.20c.orig/SeTrans.c
2894 +++ seyon-2.20c/SeTrans.c
2895 @@ -51,7 +51,7 @@
2896    ErrorIfBusy();
2897  
2898    if (disItems[0] == NULL) {
2899 -    strcpy(protocolsFile, qres.protocolsFile);
2900 +    strncpy(protocolsFile, qres.protocolsFile, REG_BUF);
2901      if (ReadParseProtFile(protocolsFile, disItems) < 0)
2902        return;
2903    }
2904 @@ -81,39 +81,47 @@
2905  
2906  void
2907  DoTransfer(widget, clientData, callData)
2908 -     Widget          widget;
2909 -     XtPointer       clientData,
2910 -                     callData;
2911 +    Widget          widget;
2912 +    XtPointer       clientData,
2913 +    callData;
2914  {
2915 -  XfwfMultiListReturnStruct *item;
2916 -  Widget          popup;
2917 -  String*         actionData = (String*)clientData;
2918 -  char            fullCommand[LRG_BUF];
2919 -
2920 -  if (clientData)
2921 -       {if ((transCurItemIndex = atoi(actionData[0]) - 1) < 0 ||  
2922 -                transCurItemIndex > MAX_ENT - 1)
2923 -          SimpleError("Invalid Entry Number");}
2924 -  else {
2925 -       if ((item = XfwfMultiListGetHighlighted(mlw))->num_selected == 0)
2926 +    XfwfMultiListReturnStruct *item;
2927 +    Widget          popup;
2928 +    String*         actionData = (String*)clientData;
2929 +    char            fullCommand[LRG_BUF];
2930 +    int             length_remaining;
2931 +
2932 +    if (clientData)
2933 +    {if ((transCurItemIndex = atoi(actionData[0]) - 1) < 0 ||  
2934 +         transCurItemIndex > MAX_ENT - 1)
2935 +        SimpleError("Invalid Entry Number");}
2936 +    else {
2937 +        if ((item = XfwfMultiListGetHighlighted(mlw))->num_selected == 0)
2938           SimpleError("No Item Selected");
2939 -       transCurItemIndex =  item->selected_items[0];
2940 -  }
2941 +        transCurItemIndex =  item->selected_items[0];
2942 +    }
2943    
2944 -  strcpy(fullCommand, protItems[transCurItemIndex]->command);
2945 +    strncpy(fullCommand, protItems[transCurItemIndex]->command, LRG_BUF);
2946  
2947 -  if (protItems[transCurItemIndex]->reqName)
2948 -       if (actionData == NULL ||  actionData[1] == NULL) {
2949 +    if (protItems[transCurItemIndex]->reqName)
2950 +    {
2951 +        if (actionData == NULL ||  actionData[1] == NULL) 
2952 +        {
2953           popup = GetShell(PopupDialogGetValue("upload", widget, exec_upload, 
2954 -                                                                                  NULL, lastUploadFile));
2955 +                                        NULL, lastUploadFile));
2956           PopupCentered(popup, (clientData) ? XtParent(GetShell(widget)) : widget);
2957           return;
2958 -       }
2959 -       else
2960 -         strcat(strcat(fullCommand, " "), actionData[1]);
2961 -  
2962 -  DestroyShell(widget);
2963 -  ShellCommand(fullCommand);
2964 +        }
2965 +        else
2966 +        {        
2967 +         length_remaining = LRG_BUF - strlen(fullCommand);
2968 +         strncat(fullCommand, " ", length_remaining);
2969 +         length_remaining -= 1;
2970 +         strncat(fullCommand, actionData[1], length_remaining);
2971 +        }
2972 +    }
2973 +    DestroyShell(widget);
2974 +    ShellCommand(fullCommand);
2975  }
2976  
2977  void
2978 @@ -133,11 +141,11 @@
2979       Widget          widget;
2980  {
2981    Widget          dialog = XtParent(widget);
2982 -  static char     cmd[REG_BUF];
2983 +  static char    *cmd;
2984  
2985 -  strcpy(lastUploadFile, XawDialogGetValueString(dialog));
2986 -  sprintf(cmd, "%s %s", protItems[transCurItemIndex]->command,
2987 -         lastUploadFile);
2988 +  strncpy(lastUploadFile, XawDialogGetValueString(dialog), REG_BUF);
2989 +  cmd = FmtString("%s %s", protItems[transCurItemIndex]->command,
2990 +         lastUploadFile, "");
2991  
2992    DestroyShell(XtParent(GetShell(widget)));
2993    ShellCommand(cmd);
2994 --- seyon-2.20c.orig/Seyon-co.ad
2995 +++ seyon-2.20c/Seyon-co.ad
2996 @@ -13,26 +13,30 @@
2997  *foreground: black
2998  *borderColor: white
2999  
3000 +*background: blue
3001 +*foreground: black
3002 +*borderColor: lightBlue
3003 +
3004  *Command.background: lightBlue
3005 -*Scrollbar.background: darkSeaGreen
3006 -*Toggle.background: darkOliveGreen
3007 -*Toggle.foreground: darkTurquoise
3008 -*List.background: grey
3009 -*XfwfMultiList.background: grey
3010 -*Text*background: grey
3011 -*Text*Scrollbar.background: darkSeaGreen
3012 +*Scrollbar.background: cyan
3013 +*Toggle.background: cyan
3014 +*Toggle.foreground: black
3015 +*List.background: tan
3016 +*XfwfMultiList.background: tan
3017 +*Text*background: tan
3018 +*Text*Scrollbar.background: cyan
3019  
3020  *ok.background: green
3021 -*cancel.background: tomato
3022 +*cancel.background: red
3023  *dismiss.background: orange
3024 -*hangup.background: orange
3025 -*exit.background: tomato
3026 -*kill.background: tomato
3027 +*hangup.background: red
3028 +*exit.background: red
3029 +*kill.background: red
3030  
3031 -*about*msg.background: grey
3032 -*about*pic.background: grey
3033 +*about*msg.background: tan
3034 +*about*pic.background: tan
3035  
3036 -*messageBox.message.background: grey
3037 +*messageBox.message.background: tan
3038  
3039 -*quickKeyBox.Command.background: darkOliveGreen
3040 -*quickKeyBox.Command.foreground: darkTurquoise
3041 +*quickKeyBox.Command.background: orange
3042 +*quickKeyBox.Command.foreground: black
3043 --- seyon-2.20c.orig/config.h
3044 +++ seyon-2.20c/config.h
3045 @@ -302,7 +302,7 @@
3046   * HDB uucp does) rather than in binary form as other uucp prgrams do
3047   */
3048  #ifndef LF_USE_ASCII_PID
3049 -#define LF_USE_ASCII_PID    NO
3050 +#define LF_USE_ASCII_PID    YES
3051  #endif
3052  
3053  /* 
3054 @@ -319,7 +319,7 @@
3055   */
3056  
3057  #ifndef LF_PATH
3058 -#define LF_PATH             "/usr/spool/uucp"
3059 +#define LF_PATH             "/var/lock"
3060  #endif
3061  
3062  /* 
3063 @@ -340,7 +340,7 @@
3064   */
3065  #ifdef linux
3066  #ifndef USE_NONSTD_BAUD
3067 -#define USE_NONSTD_BAUD     NO
3068 +#define USE_NONSTD_BAUD     YES
3069  #endif
3070  #endif /* linux */
3071  
3072 --- seyon-2.20c.orig/Imakefile
3073 +++ seyon-2.20c/Imakefile
3074 @@ -66,7 +66,7 @@
3075         rm -f version.h
3076  
3077  version.h:
3078 -       ./makever.sh
3079 +       sh ./makever.sh
3080  
3081  SeScan.o: y.tab.h
3082  
3083 --- seyon-2.20c.orig/makever.sh
3084 +++ seyon-2.20c/makever.sh
3085 @@ -48,9 +48,9 @@
3086  echo "#define VERSION \"$VERSION\"" >> version.h
3087  echo "#define REVISION \"$REVISION\"" >> version.h
3088  
3089 -echo "#ifdef IS_MAIN" >> version.h
3090 -echo "static char version[] = \"\$Revision$VERSION.$REVISION \$\";"\
3091 -     >> version.h
3092 -echo "#endif" >> version.h
3093 +#echo "#ifdef IS_MAIN" >> version.h
3094 +#echo "static char version[] = \"\$Revision$VERSION.$REVISION \$\";"\
3095 +#     >> version.h
3096 +#echo "#endif" >> version.h
3097  
3098  echo "Machine type is $machine, OS name is $system"
3099 --- seyon-2.20c.orig/SeScan.c
3100 +++ seyon-2.20c/SeScan.c
3101 @@ -95,8 +95,8 @@
3102    SC_OUTSIDE,
3103  };
3104  
3105 -static ScanState = SC_OUTSIDE;
3106 -static ScanDelim = 0;  /* Current string delimiter */
3107 +static int ScanState = SC_OUTSIDE;
3108 +static int ScanDelim = 0;      /* Current string delimiter */
3109  
3110  void NEW_STATE(st)
3111          int st;
3112 --- seyon-2.20c.orig/SeSubsX.c
3113 +++ seyon-2.20c/SeSubsX.c
3114 @@ -70,7 +70,8 @@
3115  
3116    if (onlineTime != oldOnlineTime) {
3117         oldOnlineTime = onlineTime;
3118 -       sprintf(buf, "%02d:%02d", onlineTime / 60, onlineTime % 60);
3119 +       /* Buffer is easily big enough */
3120 +       sprintf(buf, "%02ld:%02ld", onlineTime / 60, onlineTime % 60);
3121         SeSetLabel(statusWidget[0], buf);
3122    }
3123  
3124 @@ -91,6 +92,7 @@
3125      msg = qres.funMessages[msg_index++];
3126      if (msg == NULL) {
3127        msg_index = 0;
3128 +      /* Buffer is easily big enough */
3129        sprintf(vermsg, "Welcome to Seyon version %s.%s", VERSION, REVISION);
3130        msg = vermsg;
3131      }
3132 @@ -171,7 +173,8 @@
3133  
3134    procRequest.action = action;
3135  
3136 -  if (msg) strcpy(procRequest.msg, msg);
3137 +  if (msg) 
3138 +      strncpy(procRequest.msg, msg, 80);
3139    else *procRequest.msg = '\0';
3140  
3141    write_pipe_data(pd, &procRequest, sizeof(procRequest));
3142 @@ -186,8 +189,8 @@
3143    struct _procRequest procRequest;
3144  
3145    procRequest.action = action;
3146 -  strcpy(procRequest.msg, msg);
3147 -  strcpy(procRequest.arg, arg);
3148 +  strncpy(procRequest.msg, msg, 80);
3149 +  strncpy(procRequest.arg, arg, 90);
3150  
3151    write_pipe_data(child_pipe, &procRequest, sizeof(procRequest));
3152  }
3153 @@ -201,10 +204,7 @@
3154                      *b,
3155                      *c;
3156  {
3157 -  char            buffer[SM_BUF];
3158 -
3159 -  sprintf(buffer, fmt, a, b, c);
3160 -  write_child_info(pd, action, buffer);
3161 +  write_child_info(pd, action, FmtString(fmt,a,b,c));
3162  }
3163  
3164  void
3165 @@ -222,10 +222,7 @@
3166                       b,
3167                       c;
3168  {
3169 -  char            buf[REG_BUF];
3170 -
3171 -  sprintf(buf, fmt, a, b, c);
3172 -  SeyonMessage(buf);
3173 +  SeyonMessage(FmtString(fmt,a,b,c));
3174  }
3175  
3176  Boolean
3177 --- seyon-2.20c.orig/SeActions.c
3178 +++ seyon-2.20c/SeActions.c
3179 @@ -28,6 +28,7 @@
3180  /* SeDecl.h includes stdio.h */
3181  #include "SeDecl.h"
3182  #include "version.h"
3183 +#include "config.h"
3184  
3185  #define CheckNumParam(num) {if (*numParam != num) \
3186    SimpleError("Wrong Number of Parameters");}
3187 @@ -234,7 +235,7 @@
3188          Cardinal*       numParam;
3189  {
3190    int             IconifyShell();
3191 -  Widget          dirWidget;
3192 +/*  Widget          dirWidget; */
3193    static String   termWindowId = NULL;
3194    int             i;
3195  
3196 @@ -312,10 +313,18 @@
3197          Cardinal*       numParam;
3198  {
3199    void            s_set();
3200 +  int             length;
3201 +  int             length_remaining;
3202  
3203    ErrorIfBusy();
3204    CheckNumParam(2);
3205 -  sprintf((lptr = line), "%s %s", param[0], param[1]);
3206 +
3207 +  length_remaining = WBSIZE;
3208 +  length = 1 + strlen(param[0]) + strlen(param[1]);
3209 +  if(length_remaining > length)
3210 +      sprintf((lptr = line), "%s %s", param[0], param[1]);
3211 +  else
3212 +      printf("SetAction: string buffer would have overrun: %s %s\n",param[0], param[1]);
3213    eof_flag = 0;
3214    s_set();
3215  }
3216 @@ -413,12 +422,12 @@
3217    switch (intData) {
3218  
3219    case ACTION_NEW_ACTION:
3220 -       strcpy(actionName, stringData);
3221 +       strncpy(actionName, stringData, sizeof(actionName));
3222         numArgs = 0;
3223         return;
3224  
3225    case ACTION_NEW_ARG:
3226 -       strcpy((argsArray[numArgs] = args[numArgs]), stringData);
3227 +       strncpy((argsArray[numArgs] = args[numArgs]), stringData, SM_BUF);
3228         numArgs++;
3229         return;
3230  
3231 --- seyon-2.20c.orig/SeScript.c
3232 +++ seyon-2.20c/SeScript.c
3233 @@ -100,8 +100,8 @@
3234    if (qres.scriptDirectory) scriptDir = qres.scriptDirectory;
3235    else scriptDir = qres.defaultDirectory;
3236    
3237 -  strcpy(buf, scriptFileName);
3238 -  if ((scriptFP = open_file(buf, scriptDir)) == NULL)
3239 +  strncpy(buf, scriptFileName, REG_BUF);
3240 +  if ((scriptFP = open_file(buf, REG_BUF, scriptDir)) == NULL)
3241      return False;
3242    
3243    exec_close_script(scriptFP);
3244 @@ -110,31 +110,33 @@
3245  
3246  void
3247  exec_close_script(script_fp)
3248 -     FILE           *script_fp;
3249 +    FILE           *script_fp;
3250  {
3251 -  if_flag = 0;
3252 -  echo_flag = False;
3253 -  captflag = False;
3254 -  tty_flag = True;
3255 -  eof_flag = 0;
3256 +    if_flag = 0;
3257 +    echo_flag = False;
3258 +    captflag = False;
3259 +    tty_flag = True;
3260 +    eof_flag = 0;
3261  
3262 -  if (linkflag == 2)
3263 -    linkflag = 0;
3264 +    if (linkflag == 2)
3265 +        linkflag = 0;
3266  
3267 -  while (!eof_flag)
3268 -    get_line(script_fp);
3269 +    while (!eof_flag)
3270 +        get_line(script_fp);
3271  
3272 -  fclose(script_fp);
3273 -  if (captflag)
3274 -    fclose(cf);
3275 -
3276 -  eof_flag = 0;
3277 -  lptr = strcpy(line, "");
3278 -  k_when();
3279 +    fclose(script_fp);
3280 +    if (captflag)
3281 +        fclose(cf);
3282  
3283 -  linkflag = 0;
3284 +    eof_flag = 0;
3285 +    /* No buffer length problem here! */
3286 +    /* But why do this??? */
3287 +    lptr = strcpy(line, "");
3288 +    k_when();
3289  
3290 -  return;
3291 +    linkflag = 0;
3292 +
3293 +    return;
3294  }
3295  
3296  static char     wf[MAX_LINE];
3297 @@ -202,7 +204,7 @@
3298  
3299  
3300    GETTEST_ARG("waitfor");
3301 -  strcpy(wf, word);
3302 +  strncpy(wf, word, MAX_LINE);
3303  
3304    GET_ARG();
3305  
3306 @@ -331,7 +333,7 @@
3307      return;
3308    }
3309  
3310 -  strcpy(label, word);
3311 +  strncpy(label, word, WBSIZE);
3312  
3313    rewind(script_fp);
3314    while (!found) {
3315 @@ -360,7 +362,7 @@
3316    if_flag = 0;                /* reset IF flag */
3317  }
3318  
3319 -static          if_negate = 0;
3320 +static  int        if_negate = 0;
3321  
3322  static int
3323  if_test(cond)
3324 --- seyon-2.20c.orig/SeWin.c
3325 +++ seyon-2.20c/SeWin.c
3326 @@ -377,7 +377,7 @@
3327  {
3328    Widget          dialog = XtParent(valueWidget);
3329  
3330 -  strcpy(getValueDefValue, XawDialogGetValueString(dialog));
3331 +  strncpy(getValueDefValue, XawDialogGetValueString(dialog), REG_BUF);
3332    DestroyShell(dialog);
3333  
3334    (*getValueExecProc)(XtParent(GetShell(valueWidget)), getValueDefValue);
3335 @@ -745,10 +745,7 @@
3336                       b,
3337                       c;
3338  {
3339 -  char            buf[REG_BUF];
3340 -
3341 -  sprintf(buf, fmt, a, b, c);
3342 -  SePopupMsg(parent, buf);
3343 +  SePopupMsg(parent, FmtString(fmt,a,b,c));
3344  }
3345  
3346  Widget
3347 @@ -773,20 +770,16 @@
3348  }
3349  
3350  void
3351 -SePopupNoticeF(parent, title, call_back, fmt, a, b, c, d)
3352 +SePopupNoticeF(parent, title, call_back, fmt, a, b, c)
3353       Widget          parent;
3354       String          title;
3355       void            (*call_back) ();
3356       String          fmt,
3357                       a,
3358                       b,
3359 -                     c,
3360 -                     d;
3361 +                     c;
3362  {
3363 -  char            buf[REG_BUF];
3364 -
3365 -  sprintf(buf, fmt, a, b, c);
3366 -  SePopupNotice(parent, title, call_back, buf);
3367 +  SePopupNotice(parent, title, call_back, FmtString(fmt,a,b,c));
3368  }
3369  
3370  /*
3371 @@ -918,10 +911,7 @@
3372                       b,
3373                       c;
3374  {
3375 -  char            buffer[REG_BUF];
3376 -
3377 -  sprintf(buffer, fmt, a, b, c);
3378 -  SetStatusMessage(buffer);
3379 +  SetStatusMessage(FmtString(fmt,a,b,c));
3380  }
3381  
3382  /*---------------------------------------------------------------------------+
3383 --- seyon-2.20c.orig/SeString.c
3384 +++ seyon-2.20c/SeString.c
3385 @@ -22,12 +22,13 @@
3386  
3387  char
3388  itoa(num)
3389 -     int             num;
3390 +    int             num;
3391  {
3392 -  char            buf[TIN_BUF];
3393 +    char            buf[TIN_BUF];
3394  
3395 -  sprintf(buf, "%d", num);
3396 -  return buf[0];
3397 +    /* Buffer is safely big enough */
3398 +    sprintf(buf, "%d", num);
3399 +    return buf[0];
3400  }
3401  
3402  /*
3403 @@ -100,8 +101,11 @@
3404    char            buffer[REG_BUF],
3405                   *bufptr;
3406  
3407 -  strcpy(buffer, source);
3408 +  strncpy(buffer, source, REG_BUF);
3409    bufptr = str_strip_lead_end_space(buffer);
3410 +
3411 +  /* Must fit, as we can only have removed things from the original
3412 +     string */
3413    return strcpy(dest, bufptr);
3414  }
3415  
3416 @@ -130,12 +134,34 @@
3417  
3418  char*
3419  FmtString(fmt, a, b, c)
3420 -        char *fmt, *a, *b, *c;
3421 +    char *fmt, *a, *b, *c;
3422  {
3423 -  static char strBuf[LRG_BUF];
3424 +    static char     strBuf[LRG_BUF];
3425 +    static FILE    *devnull=NULL;
3426 +    int             length = 0;
3427 +
3428 +    bzero(&strBuf, LRG_BUF);
3429 +
3430 +    /* Ick... This is horrible - using a user-provided format string
3431 +       means we have no easy way of limiting string length. HACK HACK
3432 +       HACK Use fprintf to output to /dev/null and count the number of
3433 +       bytes... It would be nice if we could rely on having snprintf() */
3434 +
3435 +    if(NULL == devnull)
3436 +    {
3437 +        devnull = fopen("/dev/null", "r+");
3438 +        if(NULL == devnull)
3439 +        {
3440 +         printf("Open /dev/null failed!?!\n");
3441 +         return strBuf;
3442 +        }
3443 +        length = fprintf(devnull, fmt, a, b, c);
3444 +    }
3445 +    
3446 +    if(LRG_BUF >= length)
3447 +        sprintf(strBuf, fmt, a, b, c);
3448  
3449 -  sprintf(strBuf, fmt, a, b, c);
3450 -  return strBuf;
3451 +    return strBuf;
3452  }
3453   
3454  /*
3455 @@ -189,6 +215,7 @@
3456    if (*line == '\0')
3457      return NULL;
3458    else if (*line == '\"')
3459 +
3460      for (wrd = ++line; *line != '\"' && *line; line++);
3461    else
3462      for (wrd = line; !isspace(*line) && *line; line++);
3463 @@ -246,38 +273,38 @@
3464   * this routine is not currently used, and I'm not if it works
3465   */
3466  
3467 -char           *
3468 -get_word(str, word)
3469 -     char           *str,
3470 -                    *word;
3471 -{
3472 -  char           *wrd,
3473 -                  c;
3474 +/* char           * */
3475 +/* get_word(str, word) */
3476 +/*      char           *str, */
3477 +/*                     *word; */
3478 +/* { */
3479 +/*   char           *wrd, */
3480 +/*                   c; */
3481 +
3482 +/*   while (isspace(*str) && *str) */
3483 +/*     str++; */
3484 +
3485 +/*   if (!(*str)) */
3486 +/*     word[0] = '\0'; */
3487 +
3488 +/*   else if (*str == '\"') { */
3489 +/*     for (wrd = ++str; *str != '\"' && *str; str++); */
3490 +/*     *str = '\0'; */
3491 +/*     strcpy(word, wrd); */
3492 +/*     *str = '\"'; */
3493 +/*     str++; */
3494 +/*   } */
3495 +
3496 +/*   else { */
3497 +/*     for (wrd = str; !isspace(*str) && *str; str++); */
3498 +/*     c = *str; */
3499 +/*     *str = '\0'; */
3500 +/*     strcpy(word, wrd); */
3501 +/*     *str = c; */
3502 +/*   } */
3503  
3504 -  while (isspace(*str) && *str)
3505 -    str++;
3506 -
3507 -  if (!(*str))
3508 -    word[0] = '\0';
3509 -
3510 -  else if (*str == '\"') {
3511 -    for (wrd = ++str; *str != '\"' && *str; str++);
3512 -    *str = '\0';
3513 -    strcpy(word, wrd);
3514 -    *str = '\"';
3515 -    str++;
3516 -  }
3517 -
3518 -  else {
3519 -    for (wrd = str; !isspace(*str) && *str; str++);
3520 -    c = *str;
3521 -    *str = '\0';
3522 -    strcpy(word, wrd);
3523 -    *str = c;
3524 -  }
3525 -
3526 -  return str;
3527 -}
3528 +/*   return str; */
3529 +/* } */
3530  
3531  #if !HAVE_STRERROR
3532  
3533 --- seyon-2.20c.orig/SeParse.y
3534 +++ seyon-2.20c/SeParse.y
3535 @@ -1,7 +1,10 @@
3536  %{
3537  #include <stdio.h>
3538  #include <ctype.h>
3539 +#include <stdlib.h>
3540  #include "SeParse.h"
3541 +
3542 +int yylex(void);
3543  
3544  void (*callbackProc)();
3545  %}
3546 --- seyon-2.20c.orig/SeSet.c
3547 +++ seyon-2.20c/SeSet.c
3548 @@ -191,7 +191,7 @@
3549    struct _setValue *vptr;
3550  
3551    vptr = set_value;
3552 -  strcpy(vptr->value, modem_port);
3553 +  strncpy(vptr->value, modem_port, SM_BUF);
3554    vptr++;
3555  
3556    curValObjPtr = (vptr = (struct _setValue *)client_data);
3557 --- seyon-2.20c.orig/startup
3558 +++ seyon-2.20c/startup
3559 @@ -4,30 +4,30 @@
3560  # see the manual page for a complete listing of the keywords
3561  # that can be used with 'set'.
3562  
3563 -# set baud 9600
3564 +set baud 57600
3565  
3566  # can be 5, 6, 7, or 8
3567 -# set bits 8
3568 +set bits 8
3569  
3570  # can be 0 (= no parity), 1 (= odd parity), or 2 (= even parity)
3571  # set parity 0
3572  
3573  # can be 1 or 2
3574 -# set stopBits 1
3575 +set stopBits 1
3576  
3577  # can be nl, cr, or cr/lf
3578  # set newlineTranslation cr
3579  
3580 -# set del on
3581 -# set meta_tr on
3582 -# set xoff off 
3583 -# set rtscts on
3584 -# set autozm on
3585 +set del on
3586 +set meta_tr on
3587 +set xoff off 
3588 +set rtscts on
3589 +set autozm on
3590  # set idleGuard on
3591  
3592  # put the modem initialization string here if you like one.
3593  # most modern modems do not need it since they store their setup in 
3594  # non-volatile memory.
3595  
3596 -# echo "Initializing modem..."
3597 -# transmit "ATZ^M"
3598 +echo "Initializing modem..."
3599 +transmit "ATM0^M"
3600 --- seyon-2.20c.orig/debian/changelog
3601 +++ seyon-2.20c/debian/changelog
3602 @@ -0,0 +1,181 @@
3603 +seyon (2.20c-8) unstable; urgency=medium
3604 +
3605 +  * Added Build-Depends on bison. Closes: #123699.
3606 +  * Turned app-defaults files into conffiles after lintian warning.
3607 +
3608 + -- Steve McIntyre <93sam@debian.org>  Wed, 19 Dec 2001 17:24:13 +0000
3609 +
3610 +seyon (2.20c-7) unstable; urgency=low
3611 +
3612 +  * Added Build-Depends on libxaw-dev. Closes: #89742.
3613 +
3614 + -- Steve McIntyre <93sam@debian.org>  Thu, 15 Mar 2001 15:55:19 +0000
3615 +
3616 +seyon (2.20c-6) unstable; urgency=low
3617 +
3618 +  * Properly added menu entry. Sorry! Closes: #80160.
3619 +
3620 + -- Steve McIntyre <93sam@debian.org>  Wed, 14 Mar 2001 00:03:32 +0000
3621 +
3622 +seyon (2.20c-5) unstable; urgency=low
3623 +
3624 +  * Added xutils to Build-Depends. Closes: #89134.
3625 +  * Changed dependency on x-terminal-emulator to xterm | x-terminal-emulator to fix lintian warning.
3626 +  * Added menu hint. Closes: #80160.
3627 +  * I still think there's no better place in the menu structure than Apps/Net. Closes: #15080.
3628 +
3629 + -- Steve McIntyre <93sam@debian.org>  Sat, 10 Mar 2001 11:12:39 +0000
3630 +
3631 +seyon (2.20c-4) unstable; urgency=low
3632 +
3633 +  * New maintainer address.
3634 +  * Renamed Build-Depends-Indep to Build-Depends.
3635 +
3636 + -- Steve McIntyre <93sam@debian.org>  Wed, 07 Mar 2001 22:53:31 +0000
3637 +
3638 +seyon (2.20c-3) unstable; urgency=medium
3639 +
3640 +  * Removed a broken usleep() declaration from SeDecl.h. Closes: #87532
3641 +
3642 + -- Steve McIntyre <stevem@chiark.greenend.org.uk>  Sun, 25 Feb 2001 11:31:56 +0000
3643 +
3644 +seyon (2.20c-2) unstable; urgency=medium
3645 +
3646 +  * Move app-defaults file to /etc/X11/app-defaults. Closes: #86289
3647 +  * Now explicitly depends on x-terminal-emulator instead of imlicitly on xterm. Closes: #75343
3648 +  * Fixed includes from SePort.c, so it now builds again. Closes: 84487
3649 +  * Updated Standards-Version, added Build-Depends.
3650 +  * Fixed lots of lintian warnings.
3651 +
3652 + -- Steve McIntyre <stevem@chiark.greenend.org.uk>  Sat, 24 Feb 2001 11:01:56 +0000
3653 +
3654 +seyon (2.20c-1) unstable; urgency=low
3655 +
3656 +  * Call makever.sh with sh, so it doesn't need to be executable. Fixes Bug#38037
3657 +
3658 + -- Steve McIntyre <stevem@chiark.greenend.org.uk>  Sun, 23 May 1999 20:19:56 +0100
3659 +
3660 +seyon (2.20c-0) unstable; urgency=low
3661 +
3662 +  * Hurrah! Seyon is now free! Check the copyright file for more info. 
3663 +    Fixes Bug#20914.
3664 +  * New upstream version, new upstream maintainer (me!)
3665 +
3666 + -- Steve McIntyre <stevem@chiark.greenend.org.uk>  Sun, 09 May 1999 21:18:01 +0100
3667 +
3668 +seyon (2.14c-12) frozen unstable; urgency=low
3669 +
3670 +  * Removed obsolete dependency on xbase. Would be important bug if we weren'y non-free...
3671 +
3672 + -- Steve McIntyre <stevem@chiark.greenend.org.uk>  Sat, 06 Feb 1999 13:32:15 +0000
3673 +
3674 +seyon (2.14c-11) frozen unstable; urgency=low
3675 +
3676 +  * Replaced Suggests: for now non-existent kermit package with ckermit.
3677 +
3678 + -- Steve McIntyre <stevem@chiark.greenend.org.uk>  Thu, 14 Jan 1999 23:54:15 +0000
3679 +
3680 +seyon (2.14c-10) frozen unstable; urgency=low
3681 +
3682 +  * Integrated non-maintainer diff (9.1)
3683 +
3684 + -- Steve McIntyre <stevem@chiark.greenend.org.uk>  Wed, 30 Dec 1998 01:48:53 +0000
3685 +
3686 +seyon (2.14c-9.1) frozen unstable; urgency=low
3687 +
3688 +  * non-maintainer (binary-only) upload for Alpha
3689 +  * ignore error from $(ch_commands) as chmodding the Seyon symlink fails if
3690 +    seyon isn't installed yet (and hence no /etc/X11/seyon/Seyon file).
3691 +
3692 + -- Paul Slootman <paul@debian.org>  Tue, 29 Dec 1998 20:11:10 +0100
3693 +
3694 +seyon (2.14c-9) frozen unstable; urgency=low
3695 +
3696 +  * Fixed typo in mono app-default file; s/replcae/replace; thanks to Remo Badii <Remo.Badii@psi.ch> for pointing this one out.
3697 +
3698 + -- Steve McIntyre <stevem@chiark.greenend.org.uk>  Sun, 24 Oct 1998 20:15:08 +0100
3699 +
3700 +seyon (2.14c-8) unstable; urgency=low
3701 +
3702 +  * Fixed script-handling code so it no longer seg-faults after running a "shell" command. Fixes Bug#27015.
3703 +  * Include examples for phonelist, protocols and startup. Fixes Bug#23268.
3704 +
3705 + -- Steve McIntyre <stevem@chiark.greenend.org.uk>  Sat, 17 Oct 1998 22:03:16 +0100
3706 +
3707 +seyon (2.14c-7) frozen unstable; urgency=low
3708 +
3709 +  * Added missing sunsite reference to copyright file. Fixes bug #19870
3710 +  * Added error-checking to postinst - don't ask questions if something went wrong. Fizes bug #12608.
3711 +  * Restores X beep after use; fixes bug #17231.
3712 +
3713 + -- Steve McIntyre <stevem@chiark.greenend.org.uk>  Thu, 26 Mar 1998 22:54:54 -0000
3714 +
3715 +seyon (2.14c-6) unstable; urgency=low
3716 +
3717 +  * New maintainer
3718 +  * Added simple man page for seyon-emu.
3719 +  * Other packaging fixes to close bug #19402.
3720 +  * Uses correct devices (fixes bug #15061)
3721 +  * Postinst fixed (fixes bug #16226)
3722 +
3723 + -- Steve McIntyre <stevem@chiark.greenend.org.uk>  Sat, 14 Mar 1998 20:31:43 -0000
3724 +
3725 +seyon (2.14c-5.3) unstable; urgency=low
3726 +
3727 +  * Fixed postint to not fail if enter is pressed in response to the first
3728 +    question with no 'y' or 'n'.
3729 +  * Postinst and postrm do not use bashisms, changes them to use /bin/sh.
3730 +
3731 + -- Joey Hess <joeyh@master.debian.org>  Sun, 16 Nov 1997 00:42:06 -0500
3732 +
3733 +seyon (2.14c-5.2) unstable; urgency=low
3734 +
3735 +  * Libc6 release.
3736 +
3737 + -- Joey Hess <joeyh@master.debian.org>  Sun, 16 Nov 1997 00:42:06 -0500
3738 +
3739 +seyon (2.14c-5.1) unstable; urgency=low
3740 +
3741 +  * Changed maintainer to Debian QA Group; seyon is orphaned.
3742 +  * Updated to use new source format (#9561).
3743 +  * Use pristine sources.
3744 +  * Register with menu system.
3745 +  * Depend on xbase for xterm.
3746 +  * Use ttyS instead of cua (#4922).
3747 +  * If upgrading, and we used cua before, update the conffiles to use ttyS
3748 +    instead.
3749 +  * Include phonelist in the examples directory (#6475).
3750 +
3751 + -- Joey Hess <joeyh@master.debian.org>  Mon,  1 Sep 1997 13:13:24 -0400
3752 +
3753 +Wed Jul 24 23:18:23 1996  Sven Rudolph  <sr1@inf.tu-dresden.de>
3754 +
3755 +       * debian.control: added exetended description (Bug#3689)
3756 +
3757 +       * debian.rules: corrected multiarchitecture support
3758 +
3759 +       * debian.control: added Section: and Priority:
3760 +
3761 +Thu Apr  4 19:38:36 1996  Sven Rudolph  <sr1@inf.tu-dresden.de>
3762 +
3763 +       * releasing 2.14c-3
3764 +
3765 +       * rebuilt for ELF
3766 +
3767 +       * debian.postinst: fixed creytion of seyon-emu symlink
3768 +       
3769 +       * debian.control: removed Package_Revision field
3770 +                          added Architecture field
3771 +
3772 +Thu Sep 21 23:23:52 1995  Sven Rudolph  <sr1@inf.tu-dresden.de>
3773 +
3774 +       * moved config data to /etc/X11/seyon
3775 +
3776 +       * debian.postinst: postinst doesn't modify
3777 +                          /etc/X11/xinit/Xresources and
3778 +                          /etc/X11/xdm/Xresources now
3779 +
3780 +       * debian.control: fixed entries for DEPENDS and OPTIONAL
3781 +                         (Bug#1409, Bug#1177)
3782 +       
3783 +       * debian.control: corrected location of manpage (Bug#490)
3784 --- seyon-2.20c.orig/debian/substvars
3785 +++ seyon-2.20c/debian/substvars
3786 @@ -0,0 +1 @@
3787 +shlibs:Depends=libc6 (>= 2.2.4-4), libxaw7 (>> 4.1.0), xlibs (>> 4.1.0)
3788 --- seyon-2.20c.orig/debian/rules.old
3789 +++ seyon-2.20c/debian/rules.old
3790 @@ -0,0 +1,136 @@
3791 +#!/usr/bin/make -f
3792 +##############################################################################
3793 +# Generic debian/rules file. Based on:
3794 +#
3795 +#> Sample debian.rules file - for GNU Hello (1.3).
3796 +#> Copyright 1994,1995 by Ian Jackson.
3797 +#> I hereby give you perpetual unlimited permission to copy,
3798 +#> modify and relicense this file, provided that you do not remove
3799 +#> my name from the file itself.  (I assert my moral right of
3800 +#> paternity under the Copyright, Designs and Patents Act 1988.)
3801 +#
3802 +# Heavily modified by Joey Hess <joeyh@master.debian.org>
3803 +#
3804 +##############################################################################
3805 +#
3806 +# NOTE: You shouldn't have to edit this file. Edit debian/config instead.
3807 +# If you must edit this file to get your package to build properly, then
3808 +# I have failed. Let me know; mail me.
3809 +#
3810 +# (Currently not handled: multiple binary packages from 1 source package,
3811 +# and binary-indep rule.)
3812 +#
3813 +# NOTE: This file is designed so it doesn't need to be run as root. For
3814 +# actions that require that the user be root, the root password will be
3815 +# prompted for, if you're not already root.
3816 +#
3817 +##############################################################################
3818 +#
3819 +# Changelog:
3820 +# * Fakeroot and sudo fixes.
3821 +# * Run dpkg-gencontrol after debstd, and delete substvars during clean.
3822 +# * Clean up junk files in subdirs.
3823 +# * Modifications for multiple binary package support.
3824 +# * Call debstd after fixing file perms.
3825 +# * Don't pass package name to debstd + fixes for multi binary packages. 
3826 +# * Use build-stamp instead of build.
3827 +# * New email address.
3828 +# * Added changelog.
3829 +#
3830 +##############################################################################
3831 +
3832 +# Include config file.
3833 +include debian/config
3834 +
3835 +# Generate a makefile (via configure scriopt or xmkmf).
3836 +makefile-stamp:
3837 +  ifeq ($(strip $(use_imakefile)),y)
3838 +       xmkmf -a
3839 +  endif 
3840 +       $(use_configure)
3841 +       touch makefile-stamp
3842 +
3843 +# Preserve some files that may get deleted/overwritten/modified otherwise.
3844 +preserve-stamp:
3845 +  ifneq ($(strip $(preserve_files)),)
3846 +       $(foreach file,$(preserve_files),cp $(file) $(file).preserved ;)
3847 +  endif
3848 +       touch preserve-stamp
3849 +
3850 +build-stamp: preserve-stamp makefile-stamp
3851 +       $(checkdir)
3852 +       $(build_command)
3853 +       touch build-stamp
3854 +
3855 +build: build-stamp
3856 +
3857 +clean: preserve-stamp makefile-stamp
3858 +       $(checkdir)
3859 +  # Do actual cleaning up here.
3860 +       -rm -f build-stamp
3861 +       $(clean_command)
3862 +       -find . -name '\#*\#' -o -name '*~' -o -name 'DEADJOE' -exec rm -f {} \;
3863 +       -rm -f debian/files* debian/substvars debian/*.substvars $(clean_files)
3864 +       $(clean_tmp)
3865 +  # Remove Makefile that xmkmf creates.
3866 +  ifeq ($(strip $(use_imakefile)),y)
3867 +       -rm -f Makefile
3868 +  endif
3869 +  # If we preserved some files, we need to restore them now.
3870 +  ifneq ($(strip $(preserve_files)),)
3871 +       $(foreach file,$(preserve_files),mv -f $(file).preserved $(file); )
3872 +  endif
3873 +       -rm -f preserve-stamp makefile-stamp
3874 +
3875 +# Build architecture-independent files here.
3876 +# (not yet set up to be used)
3877 +binary-indep: build
3878 +       $(checkdir)
3879 +
3880 +# Build architecture-dependent files here.
3881 +binary-arch: build
3882 +       $(checkdir)
3883 +       $(clean_tmp)
3884 +       $(install_command)
3885 +  # Set permissions and check package for problems, then build package.
3886 +       @if [ "`whoami`" != root ]; then \
3887 +               echo -e "\n ** Enter root password to set file permissions."; \
3888 +               sudo debian/rules setperms; \
3889 +       else \
3890 +               debian/rules setperms; \
3891 +       fi
3892 +
3893 +# This must be run suid root, it sets the file permissions in debian/tmp
3894 +setperms:
3895 +       chown -R root.root debian/tmp
3896 +       chmod -R g-ws debian/tmp
3897 +  # Debstd handles lots of nasty details. This requires that the debmake
3898 +  # package is installed.
3899 +       -debstd $(debstd) $(docs)
3900 +       dpkg-gencontrol -p$(package)
3901 +       $(ch_commands)
3902 +       dpkg --build debian/tmp ..
3903 +
3904 +define checkdir
3905 +       @test -e $(test_file) -a -f debian/rules || (echo -e "\n\
3906 +       ** \"$(test_file)\" or \"debian/rules\" does not exist.\n\
3907 +       ** Either the package is not unpacked in this directory, or\n\
3908 +       ** an incorrect test_file is specified in debian/config.\n" && false)
3909 +endef
3910 +
3911 +# This rm's the debian/tmp directory, and any other directories specified in 
3912 +# tmpdirs
3913 +define clean_tmp
3914 +       -rm -rf debian/tmp >/dev/null 2>&1
3915 +       @if [ -d debian/tmp -o -n "$(tmp_dirs)" ]; then \
3916 +               if  [ "`whoami`" != root ]; then \
3917 +                       echo -e "\n ** Enter root password to remove temporary directories $(tmp_dirs)"; \
3918 +                       sudo rm -rf debian/tmp $(tmp_dirs); \
3919 +               else \
3920 +                       rm -rf debian/tmp $(tmp_dirs); \
3921 +               fi; \
3922 +       fi
3923 +endef
3924 +
3925 +binary: binary-indep binary-arch
3926 +.PHONY: clean setperms binary
3927 --- seyon-2.20c.orig/debian/postinst
3928 +++ seyon-2.20c/debian/postinst
3929 @@ -0,0 +1,61 @@
3930 +#!/bin/sh -e
3931 +
3932 +case "$1" in 
3933 +       abort-upgrade|abort-remove|abort-deconfigure)
3934 +       exit 0;; # Don't prompt for configuration if something went wrong...
3935 +esac
3936 +
3937 +PACKAGE=seyon
3938 +
3939 +if [ "$1" = "configure" ]; then
3940 +    if [ -d /usr/doc -a ! -e /usr/doc/$PACKAGE -a -d /usr/share/doc/$PACKAGE ]; then
3941 +        ln -sf ../share/doc/$PACKAGE /usr/doc/$PACKAGE
3942 +    fi
3943 +fi
3944 +
3945 +if test -x /usr/bin/update-menus; then update-menus; fi
3946 +
3947 +EMU=/etc/X11/seyon/seyon-emu
3948 +COLORDEFAULTS=/etc/X11/seyon/Seyon
3949 +MODEMDEFAULTS=/etc/X11/seyon/Seyon-modem
3950 +
3951 +# Old versions of seyon were configured to use /dev/cua devices, we need
3952 +# to change that to /dev/ttyS now.
3953 +if [ -f $MODEMDEFAULTS ]; then
3954 +       if grep -q /dev/cua $MODEMDEFAULTS; then
3955 +               echo "Reconfiguring seyon to use /dev/ttyS devices.."
3956 +               sed -e 's:/dev/cua:/dev/ttyS:' <$MODEMDEFAULTS > $MODEMDEFAULTS.new
3957 +               mv $MODEMDEFAULTS.new $MODEMDEFAULTS
3958 +       fi
3959 +fi
3960 +# In case the .new file is left around by this script dying before, remove it.
3961 +rm -f $MODEMDEFAULTS.new
3962 +
3963 +if [ ! -f $COLORDEFAULTS -o ! -f $MODEMDEFAULTS  ]; then
3964 +    
3965 +    # No longer need to worry about colour/mono app-defaults any more; the
3966 +    # system will get it right...
3967 +
3968 +       ln -sf /usr/bin/x-terminal-emulator $EMU
3969 +
3970 +       echo
3971 +       echo "Where is your modem located?"
3972 +       echo "(0) /dev/ttyS0 (equivalent to DOS COM1)"
3973 +       echo "(1) /dev/ttyS1 (equivalent to DOS COM2)"
3974 +       echo "(2) /dev/ttyS2 (equivalent to DOS COM3)"
3975 +       echo "(3) /dev/ttyS3 (equivalent to DOS COM4)"
3976 +       echo -n "Enter (0/1/2/3) -> "
3977 +       read PORT
3978 +       case "$PORT" in
3979 +               0|1|2|3) 
3980 +                       echo >> $MODEMDEFAULTS
3981 +                       echo 'seyon*modems: /dev/ttyS'$PORT >> $MODEMDEFAULTS
3982 +                               echo "Modem configured for: /dev/ttyS$PORT";;
3983 +               *)      echo "Modem NOT configured.";;
3984 +       esac
3985 +       echo
3986 +       echo "*** Important ***"
3987 +       echo "Users must be added to the 'dialout' group to allow access to the modem"
3988 +       echo "device."
3989 +fi
3990 +exit 0
3991 --- seyon-2.20c.orig/debian/config
3992 +++ seyon-2.20c/debian/config
3993 @@ -0,0 +1,84 @@
3994 +# Edit this file to configure debian/rules to build a package.
3995 +# No modification of debian/rules should be neccessary. (Famous last words!)
3996 +#
3997 +# File by Joey Hess <joeyh@master.debian.org>
3998 +
3999 +# What is the name of the primary package in this sourcepackage?
4000 +package=seyon
4001 +
4002 +# Parameters to pass to rules file. This can include doc files, or 
4003 +# command-line switches.
4004 +docs=1-{BUGREPORT,FAQ,HISTORY,README,SURVEY,TODO}
4005 +examples=phonelist protocols startup
4006 +binfiles=$(package)
4007 +copyright=debian/copyright
4008 +
4009 +# What file must exist in the current directory if the package is
4010 +# properly unpacked here?
4011 +test_file=$(package).h
4012 +
4013 +# Does this package build from an Imakefile?
4014 +# If so, uncomment the line below.
4015 +use_imakefile=y
4016 +
4017 +# Does this package build from a Configure script?
4018 +# If so, uncomment the line below and enter the command to run to run the 
4019 +# Configure script (ie: "./Configure")
4020 +#use_configure=./Configure
4021 +
4022 +# What commands to run to build the package?
4023 +define build_command
4024 +       $(MAKE)
4025 +endef
4026 +
4027 +# What commands to run to clean up after a build?
4028 +define clean_command
4029 +       -$(MAKE) -i clean
4030 +endef
4031 +
4032 +# List here any files that must be removed during "debian/rules clean"
4033 +# that clean_command doesn't take care of.
4034 +clean_files=
4035 +
4036 +# List here any temporary directories that are used to build multiple-
4037 +# binary packages. These are automatically created and removed. 
4038 +tmp_dirs=
4039 +
4040 +# List here any files that should be preserved during a build, and restored
4041 +# to their original state during a clean. For example, if the package comes
4042 +# with both an Imakefile and a Makefile, and xmkmf is run, list the original
4043 +# Makefile here so it will be backed up before it is overwritten my xmkmf.
4044 +preserve_files=Makefile
4045 +
4046 +# What command to run to install the package into debian/tmp?
4047 +# You might want to edit the package's Makefile and add $(PREFIX) 
4048 +# to all the paths it installs files to. or, you can just write 
4049 +# your own install commands here instead.
4050 +#
4051 +# Note that debian/* and the files in /usr/share/doc will be installed 
4052 +# properly for you, you don't need to do that here.
4053 +#
4054 +define install_command
4055 +       $(MAKE) DESTDIR=debian/tmp install
4056 +       install -d debian/tmp/etc/X11/seyon
4057 +       ln -sf /etc/X11/seyon/seyon-emu debian/tmp/usr/X11R6/bin/seyon-emu
4058 +       install -d debian/tmp/usr/X11R6/man/man1
4059 +       install -m 644 seyon.man debian/tmp/usr/X11R6/man/man1/seyon.1x
4060 +       install -m 644 debian/seyon-emu.man debian/tmp/usr/X11R6/man/man1/seyon-emu.1x
4061 +       # Install 1-CHANGES as upstream changelog.
4062 +       install -d debian/tmp/usr/share/doc/$(package)
4063 +       cp 1-CHANGES debian/tmp/usr/share/doc/$(package)/changelog
4064 +       strip --remove-section=.comment --remove-section=.note debian/tmp/usr/X11R6/bin/seyon
4065 +       install -d debian/tmp/usr/lib/menu
4066 +       install -m 644 debian/menu debian/tmp/usr/lib/menu/seyon
4067 +endef
4068 +
4069 +# After being installed in debian/tmp, everything is chowned to root.root,
4070 +# and chmod g-ws is run on everything. Enter below any chmod commands you
4071 +# need to run to set files to the proper permissions. This is where you
4072 +# can make programs be suid, etc.
4073 +# (Note that these commands will be run as root.)
4074 +define ch_commands
4075 +       chmod 644 debian/tmp/etc/X11/app-defaults/*
4076 +       chmod 644 debian/tmp/usr/X11R6/lib/X11/seyon.help
4077 +endef
4078 --- seyon-2.20c.orig/debian/prerm
4079 +++ seyon-2.20c/debian/prerm
4080 @@ -0,0 +1,7 @@
4081 +#!/bin/sh
4082 +
4083 +PACKAGE=seyon
4084 +
4085 +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/$PACKAGE ]; then
4086 +    rm -f /usr/doc/$PACKAGE
4087 +fi
4088 --- seyon-2.20c.orig/debian/rules
4089 +++ seyon-2.20c/debian/rules
4090 @@ -0,0 +1,140 @@
4091 +#!/usr/bin/make -f
4092 +##############################################################################
4093 +# Generic debian/rules file. Based on:
4094 +#
4095 +#> Sample debian.rules file - for GNU Hello (1.3).
4096 +#> Copyright 1994,1995 by Ian Jackson.
4097 +#> I hereby give you perpetual unlimited permission to copy,
4098 +#> modify and relicense this file, provided that you do not remove
4099 +#> my name from the file itself.  (I assert my moral right of
4100 +#> paternity under the Copyright, Designs and Patents Act 1988.)
4101 +#
4102 +# Heavily modified by Joey Hess <jeh22@cornell.edu>
4103 +#
4104 +##############################################################################
4105 +#
4106 +# NOTE: You shouldn't have to edit this file. Edit debian/config instead.
4107 +# If you must edit this file to get your package to build properly, then
4108 +# I have failed. Let me know; mail jeh22@cornell.edu.
4109 +#
4110 +# (Currently not handled: multiple binary packages from 1 source package,
4111 +# and binary-indep rule.)
4112 +#
4113 +# NOTE: This file is designed so it doesn't need to be run as root. For
4114 +# actions that require that the user be root, the root password will be
4115 +# prompted for, if you're not already root.
4116 +#
4117 +##############################################################################
4118 +
4119 +# Include config file.
4120 +include debian/config
4121 +
4122 +# Generate a makefile (via configure scriopt or xmkmf).
4123 +makefile-stamp:
4124 +  ifeq ($(strip $(use_imakefile)),y)
4125 +       xmkmf -a
4126 +  endif 
4127 +       $(use_configure)
4128 +       touch makefile-stamp
4129 +
4130 +# Preserve some files that may get deleted/overwritten/modified otherwise.
4131 +preserve-stamp:
4132 +  ifneq ($(strip $(preserve_files)),)
4133 +       $(foreach file,$(preserve_files),-cp $(file) $(file).preserved)
4134 +  endif
4135 +       touch preserve-stamp
4136 +
4137 +build: preserve-stamp makefile-stamp
4138 +       $(checkdir)
4139 +       $(build_command)
4140 +       touch build
4141 +
4142 +clean: preserve-stamp makefile-stamp
4143 +       $(checkdir)
4144 +  # Do actual cleaning up here.
4145 +       -rm -f build
4146 +       $(clean_command)
4147 +       -rm -rf *~ debian/*~ debian/files* $(clean_files)
4148 +       $(clean_tmp)
4149 +  # Remove Makefile that xmkmf creates.
4150 +  ifeq ($(strip $(use_imakefile)),y)
4151 +       -rm -f Makefile
4152 +  endif
4153 +  # If we preserved some files, we need to restore them now.
4154 +  ifneq ($(strip $(preserve_files)),)
4155 +       $(foreach file,$(preserve_files),-mv -f $(file).preserved $(file))
4156 +  endif
4157 +       -rm -f preserve-stamp makefile-stamp
4158 +
4159 +# Build architecture-independent files here.
4160 +# (not yet set up to be used)
4161 +binary-indep: build
4162 +       $(checkdir)
4163 +
4164 +# Build architecture-dependent files here.
4165 +binary-arch: build
4166 +       $(checkdir)
4167 +       $(clean_tmp)
4168 +       install -d debian/tmp debian/tmp/DEBIAN debian/tmp/usr/share/doc/$(package)
4169 +       $(install_command)
4170 +  # Compress manpages
4171 +       -gzip -9v -r debian/tmp/usr/man/ debian/tmp/usr/X11R6/man/
4172 +  # Install documentation files, compressed.
4173 +  ifneq ($(strip $(docs)),)
4174 +       cp $(docs) debian/tmp/usr/share/doc/$(package)
4175 +       gzip -9v debian/tmp/usr/share/doc/$(package)/*
4176 +  endif
4177 +  # Install copyright file, don't compress.
4178 +  ifneq ($(strip $(copyright)),)
4179 +       cp $(copyright) debian/tmp/usr/share/doc/$(package)/copyright
4180 +  endif
4181 +  # Install examples, compressed.
4182 +  ifneq ($(strip $(examples)),)
4183 +       install -d debian/tmp/usr/share/doc/$(package)/examples
4184 +       cp $(examples) debian/tmp/usr/share/doc/$(package)/examples
4185 +       gzip -9v debian/tmp/usr/share/doc/$(package)/examples/*
4186 +  endif
4187 +  # Install other debian files if they exist.
4188 +       -install -m 644 debian/changelog debian/tmp/usr/share/doc/$(package)/changelog.Debian
4189 +       -gzip -9v debian/tmp/usr/share/doc/$(package)/changelog.Debian
4190 +       -install -m 644 debian/conffiles debian/tmp/DEBIAN/conffiles
4191 +       -install -m 755 debian/preinst debian/tmp/DEBIAN/preinst
4192 +       -install -m 755 debian/postinst debian/tmp/DEBIAN/postinst
4193 +       -install -m 755 debian/prerm debian/tmp/DEBIAN/prerm
4194 +       -install -m 755 debian/postrm debian/tmp/DEBIAN/postrm
4195 +  # Generate control file.
4196 +       dpkg-shlibdeps $(binfiles)
4197 +       dpkg-gencontrol -isp
4198 +  # Set permissions.
4199 +       @[ "`whoami`" != root ] && \
4200 +               echo -e "\n ** Enter root password to set file permissions."; \
4201 +       debian/rules setperms
4202 +  # Actually build the .deb file.
4203 +       dpkg --build debian/tmp ..
4204 +
4205 +# This must be run suid root, it sets the file permissions in debian/tmp
4206 +setperms:
4207 +       chown -R root.root debian/tmp
4208 +       chmod -R g-ws debian/tmp
4209 +       -$(ch_commands)
4210 +
4211 +define checkdir
4212 +       @test -f $(test_file) -a -f debian/rules || (echo -e "\n\
4213 +       ** \"$(test_file)\" or \"debian/rules\" does not exist.\n\
4214 +       ** Either \"$(package)\" is not unpacked in this directory, or\n\
4215 +       ** an incorrect test_file is specified in debian/config.\n" && false)
4216 +endef
4217 +
4218 +# This rm's the debian/tmp directory.
4219 +define clean_tmp
4220 +       -rm -rf debian/tmp >/dev/null 2>&1
4221 +       @if [ -d debian/tmp ]; then \
4222 +               if  [ "`whoami`" != root ]; then \
4223 +                       echo -e "\n ** Enter root password to remove debian/tmp."; \
4224 +               fi; \
4225 +               rm -rf debian/tmp; \
4226 +       fi
4227 +endef
4228 +
4229 +binary: binary-indep binary-arch
4230 +.PHONY: clean setperms binary
4231 --- seyon-2.20c.orig/debian/control
4232 +++ seyon-2.20c/debian/control
4233 @@ -0,0 +1,18 @@
4234 +Source: seyon
4235 +Section: comm
4236 +Priority: extra
4237 +Maintainer: Steve McIntyre <93sam@debian.org>
4238 +Standards-Version: 3.2.1.0
4239 +Build-Depends: xlibs-dev, xutils, libxaw-dev, bison
4240 +
4241 +Package: seyon
4242 +Architecture: any
4243 +Depends: ${shlibs:Depends}, xterm | x-terminal-emulator
4244 +Suggests: lrzsz, ckermit
4245 +Description: Full-featured native X11 communications program.
4246 + Seyon is a complete full-featured modem communications package
4247 + for the X Window System. Some of its features are:
4248 +  - dialing directory
4249 +  - terminal emulation (DEC VT02, Tektronix 4014 and ANSI)
4250 +  - script language
4251 +  - Zmodem
4252 --- seyon-2.20c.orig/debian/menu
4253 +++ seyon-2.20c/debian/menu
4254 @@ -0,0 +1,3 @@
4255 +?package(seyon):needs=x11 section="Apps/Net" hints="Terminal" \
4256 +       title="Seyon" longtitle="Seyon communications program" \
4257 +       command="seyon"
4258 --- seyon-2.20c.orig/debian/copyright
4259 +++ seyon-2.20c/debian/copyright
4260 @@ -0,0 +1,46 @@
4261 +This is a Debian prepackaged version of seyon.
4262 +
4263 +This package was originally put together by Joey Hess
4264 +<joeyh@master.debian.org>, using sources from:
4265 +
4266 +ftp://sunsite.unc.edu/pub/Linux/apps/serialcomm/dialout/Seyon-2.14c-tar.gz
4267 +
4268 +The following copyright applied to the old package:
4269 +
4270 +======================================================================
4271 +
4272 +  Seyon is Copyright (c) 1992 of Muhammad M. Saggaf. Seyon is not
4273 +  public domain. Permission is granted to use and distribute Seyon
4274 +  freely for any use and to sell it at any price without reference to
4275 +  the copyright owner provided that in all above cases Seyon is intact
4276 +  and is not made part of any program either in whole or in part and
4277 +  that this copyright notice is included with Seyon. Permission is
4278 +  also granted to modify the source as long as the modified source is
4279 +  not distributed.
4280 +
4281 +======================================================================
4282 +
4283 +As of May 1999, Muhammad M. Saggaf has given permission for seyon to
4284 +be released and maintained under GPL (see
4285 +/usr/share/common-licenses/GPL):
4286 +
4287 +Dear Steve:
4288 +
4289 +I received your letter today (yes, I know it took a long time, it took a
4290 +trip half-way around the world and then back to my current address in the
4291 +U.S.). I share your view about license for Seyon, I think it is too
4292 +restrictive, especially that I'm not actively maintaining it. The purpose
4293 +behind that restriction was to prevent incompatible versions, really, but I
4294 +don't think it was the correct way of doing that. You have my permission to
4295 +modify the license (e.g. the GPL is just fine) and distribute the package
4296 +with the new license.
4297 +
4298 +My very best wishes,
4299 +
4300 +-- M. Saggaf
4301 +   msaggaf@erl.mit.edu
4302 +
4303 +For now I am the new upstream maintainer as well as the Debian
4304 +maintainer for the swyon package. Upstream sources without the Debian
4305 +patches will be made available shortly from sunsite.unc.edu (now
4306 +better known as metalab.unc.edu), as above.
4307 --- seyon-2.20c.orig/debian/postrm
4308 +++ seyon-2.20c/debian/postrm
4309 @@ -0,0 +1,12 @@
4310 +#!/bin/sh -e
4311 +
4312 +if test -x /usr/bin/update-menus; then update-menus; fi
4313 +
4314 +XTERM=/etc/X11/seyon/seyon-emu
4315 +COLORDEFAULTS=/etc/X11/seyon/Seyon
4316 +MODEMDEFAULTS=/etc/X11/seyon/Seyon-modem
4317 +
4318 +if [ x$1 = xpurge ]; then
4319 +       rm -f $XTERM $COLORDEFAULTS $MODEMDEFAULTS
4320 +       rmdir /etc/X11/seyon /etc/X11 2>/dev/null || true
4321 +fi
4322 --- seyon-2.20c.orig/debian/seyon-emu.man
4323 +++ seyon-2.20c/debian/seyon-emu.man
4324 @@ -0,0 +1,23 @@
4325 +.TH SEYON 1 \" -*- nroff -*-
4326 +
4327 +.SH NAME
4328 +Seyon \- X11 Telecommunications Package.
4329 +
4330 +.SH SYNOPSIS
4331 +.B seyon-emu
4332 +
4333 +.SH DESCRIPTION
4334 +
4335 +.P 
4336 +
4337 +\fISeyon-emu\fP is the name of the terminal-emulator program called by
4338 +\fIseyon\fP. This will normally simply be a symbolic link to another
4339 +program (such as \fIxterm\fP or \fIrxvt\fP). Therefore read the manual
4340 +page of the appropriate program for its options.
4341 +
4342 +.SH SEE ALSO
4343 +rxvt(1), xterm(1), seyon(1)
4344 +
4345 +This manual page added by Steve McIntyre <stevem@chiark.greenend.org.uk>,
4346 +Debian maintainer of seyon, 14th March 1998. 
4347 +
4348 --- seyon-2.20c.orig/debian/examples
4349 +++ seyon-2.20c/debian/examples
4350 @@ -0,0 +1,7 @@
4351 +script.QWK
4352 +script.unix
4353 +script.CIS
4354 +script.PCBoard
4355 +startup
4356 +protocols
4357 +phonelist
4358 --- seyon-2.20c.orig/debian/conffiles
4359 +++ seyon-2.20c/debian/conffiles
4360 @@ -0,0 +1,2 @@
4361 +/etc/X11/app-defaults/Seyon
4362 +/etc/X11/app-defaults/Seyon-color
4363 --- seyon-2.20c.orig/typescript
4364 +++ seyon-2.20c/typescript
4365 @@ -0,0 +1,37 @@
4366 +Script started on Thu Feb 24 23:08:45 2000
4367 +hammer:~/debian/seyon/seyon-2.20c$ make clean && make\r
4368 +rm -f seyon\r
4369 +rm -f version.h y.tab.* SeParse.c\r
4370 +rm -f *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut  "#"*\r
4371 +rm -f version.h\r
4372 +sh ./makever.sh\r
4373 +Machine type is i686, OS name is Linux\r
4374 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o Seyon.o Seyon.c\r
4375 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeActions.o SeActions.c\r
4376 +bison -y -d SeParse.y\r
4377 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeScan.o SeScan.c\r
4378 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeDial.o SeDial.c\r
4379 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeErr.o SeErr.c\r
4380 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeGeneric.o SeGeneric.c\r
4381 +rm -f SeInit.o\r
4382 +gcc -c -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO   -DHELPFILE=\"/usr/X11R6/lib/X11/seyon.help\" SeInit.c\r
4383 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeIo.o SeIo.c\r
4384 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeMisc.o SeMisc.c\r
4385 +mv -f y.tab.c SeParse.c\r
4386 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeParse.o SeParse.c\r
4387 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SePort.o SePort.c\r
4388 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeScript.o SeScript.c\r
4389 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeSet.o SeSet.c\r
4390 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeSig.o SeSig.c\r
4391 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeString.o SeString.c\r
4392 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeSubs.o SeSubs.c\r
4393 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeSubsX.o SeSubsX.c\r
4394 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeSupp.o SeSupp.c\r
4395 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeTerm.o SeTerm.c\r
4396 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeTrans.o SeTrans.c\r
4397 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o SeWin.o SeWin.c\r
4398 +gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o MultiList.o MultiList.c\r
4399 +rm -f seyon\r
4400 +gcc -o seyon -O2 -g -Wall      -L/usr/X11R6/lib Seyon.o SeActions.o SeScan.o SeDial.o SeErr.o SeGeneric.o              SeInit.o SeIo.o SeMisc.o SeParse.o SePort.o SeScript.o          SeSet.o SeSig.o SeString.o SeSubs.o SeSubsX.o SeSupp.o          SeTerm.o SeTrans.o SeWin.o MultiList.o -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11      \r
4401 +hammer:~/debian/seyon/seyon-2.20c$ 
4402 +Script done on Thu Feb 24 23:09:17 2000
This page took 0.689255 seconds and 3 git commands to generate.