projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
date and time created 83/03/02 13:29:58 by ralph
[unix-history]
/
usr
/
src
/
usr.bin
/
tip
/
acu.c
diff --git
a/usr/src/usr.bin/tip/acu.c
b/usr/src/usr.bin/tip/acu.c
index
6094c8a
..
0b51a8d
100644
(file)
--- a/
usr/src/usr.bin/tip/acu.c
+++ b/
usr/src/usr.bin/tip/acu.c
@@
-1,4
+1,4
@@
-/* acu.c 4.
2 81/10/02
*/
+/* acu.c 4.
7 82/07/29
*/
#include "tip.h"
#include <setjmp.h>
#include "tip.h"
#include <setjmp.h>
@@
-34,7
+34,7
@@
connect()
if (!DU) { /* regular connect message */
if (CM != NOSTR)
write(FD, cp, size(CM));
if (!DU) { /* regular connect message */
if (CM != NOSTR)
write(FD, cp, size(CM));
- return(NOSTR);
+ return
(NOSTR);
}
/*
* @ =>'s use data base in PHONES environment variable
}
/*
* @ =>'s use data base in PHONES environment variable
@@
-58,17
+58,18
@@
connect()
exit(1);
}
if ((acu = acutype(AT)) == NOACU)
exit(1);
}
if ((acu = acutype(AT)) == NOACU)
- return("unknown ACU type");
+ return
("unknown ACU type");
if (*cp != '@') {
while (*cp) {
if (*cp != '@') {
while (*cp) {
- for (phnum = cp; any(*cp, "0123456789-*="); cp++)
+ for (phnum = cp; any(*cp, "0123456789-*=
&%
"); cp++)
;
;
- *cp++ = '\0';
+ if (*cp)
+ *cp++ = '\0';
if (conflag = (*acu->acu_dialer)(phnum, CU)) {
logent(value(HOST), phnum, acu->acu_name,
"call completed");
if (conflag = (*acu->acu_dialer)(phnum, CU)) {
logent(value(HOST), phnum, acu->acu_name,
"call completed");
- return(NOSTR);
+ return
(NOSTR);
} else
logent(value(HOST), phnum, acu->acu_name,
"no answer");
} else
logent(value(HOST), phnum, acu->acu_name,
"no answer");
@@
-77,14
+78,14
@@
connect()
} else {
if ((fd = fopen(PH, "r")) == NOFILE) {
printf("%s: ", PH);
} else {
if ((fd = fopen(PH, "r")) == NOFILE) {
printf("%s: ", PH);
- return("can't open phone number file");
+ return
("can't open phone number file");
}
while (fgets(string, sizeof(string), fd) != NOSTR) {
for (cp = string; !any(*cp, " \t\n"); cp++)
;
if (*cp == '\n') {
fclose(fd);
}
while (fgets(string, sizeof(string), fd) != NOSTR) {
for (cp = string; !any(*cp, " \t\n"); cp++)
;
if (*cp == '\n') {
fclose(fd);
- return("unrecognizable host name");
+ return
("unrecognizable host name");
}
*cp++ = '\0';
if (strcmp(string, value(HOST)))
}
*cp++ = '\0';
if (strcmp(string, value(HOST)))
@@
-93,9
+94,9
@@
connect()
cp++;
if (*cp == '\n') {
fclose(fd);
cp++;
if (*cp == '\n') {
fclose(fd);
- return("missing phone number");
+ return
("missing phone number");
}
}
- for (phnum = cp; any(*cp, "0123456789-*="); cp++)
+ for (phnum = cp; any(*cp, "0123456789-*=
&%
"); cp++)
;
*cp = '\0';
;
*cp = '\0';
@@
-103,7
+104,7
@@
connect()
fclose(fd);
logent(value(HOST), phnum, acu->acu_name,
"call completed");
fclose(fd);
logent(value(HOST), phnum, acu->acu_name,
"call completed");
- return(NOSTR);
+ return
(NOSTR);
} else
logent(value(HOST), phnum, acu->acu_name,
"no answer");
} else
logent(value(HOST), phnum, acu->acu_name,
"no answer");
@@
-113,7
+114,7
@@
connect()
}
if (!tried)
logent(value(HOST), "", acu->acu_name, "missing phone number");
}
if (!tried)
logent(value(HOST), "", acu->acu_name, "missing phone number");
- return(tried ? "no answer" : "missing phone number");
+ return
(tried ? "no answer" : "missing phone number");
}
disconnect()
}
disconnect()
@@
-130,18
+131,18
@@
static int
acuabort(s)
{
signal(s, SIG_IGN);
acuabort(s)
{
signal(s, SIG_IGN);
- longjmp(jmpbuf);
+ longjmp(jmpbuf
, 1
);
}
static acu_t *
acutype(s)
}
static acu_t *
acutype(s)
-register char *s;
+
register char *s;
{
register acu_t *p;
extern acu_t acutable[];
for (p = acutable; p->acu_name != '\0'; p++)
if (!strcmp(s, p->acu_name))
{
register acu_t *p;
extern acu_t acutable[];
for (p = acutable; p->acu_name != '\0'; p++)
if (!strcmp(s, p->acu_name))
- return(p);
- return(NOACU);
+ return
(p);
+ return
(NOACU);
}
}