[3855] in Athena Bugs
Silly bug in zwrite
daemon@ATHENA.MIT.EDU (Barr3y Jaspan)
Fri Dec 22 12:43:56 1989
Date: Fri, 22 Dec 89 12:43:27 -0500
From: Barr3y Jaspan <bjaspan@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU, testers@ATHENA.MIT.EDU, zephyr-dev@ATHENA.MIT.EDU
~% /usr/athena/zwrite -i PERSONAL
No recipients specified.
Usage: /usr/athena/zwrite [-a] [-o] [-d] [-v] [-q] [-n] [-t] [-u]
[-c class] [-i inst] [-f fsname] [user ...] [-m message]
-f and -c are mutually exclusive
-f and -i are mutually exclusive
recipients must be specified unless -c or -f specifies a class
other than the default class or -i or -f specifies an instance
other than the default or urgent instance
~% /usr/athena/zwrite -i personal
Type your message now. End with control-D or a dot on a line by itself.
^C~%
The bug here is obvious (zwrite does a strcmp on the instance and
DEFAULT_INST). Here's a patch. As the behavior of zwrite is based on
specified classes and instances in a complicated way, I suggest this
be tested thoroughly.. (can you spell "Cop out"?)
Barr3y
------ snip snip -------
46a47
> int def_class, def_inst, urge_inst;
64c65,66
< tabexpand = 1;
---
> urge_inst = 0;
> tabexpand = def_class = def_inst = 1;
68a71
> def_class = 0;
74a78
> def_inst = 0;
98a103
> def_class = def_inst = 1;
116a122
> urge_inst = 1;
122a129
> def_inst = 0;
129a137
> def_class = 0;
137a146
> def_class = def_inst = 0;
159,161c168
< if (!nrecips && !(strcmp(class, DEFAULT_CLASS) ||
< (strcmp(inst, DEFAULT_INSTANCE) &&
< strcmp(inst, URGENT_INSTANCE)))) {
---
> if (!nrecips && (def_class && (def_inst || urge_inst))) {