diff options
author | joerg <joerg@FreeBSD.org> | 1997-10-15 12:16:37 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1997-10-15 12:16:37 +0000 |
commit | 213e132f58cfb18b8eda2e64a6ed23ffc6002932 (patch) | |
tree | fe5d564cf94975b6f1ae22f91060599bbf4244f8 /usr.sbin/lpr | |
parent | 29fe905ae5b25aaf30812c52457dc4d8a523452c (diff) | |
download | FreeBSD-src-213e132f58cfb18b8eda2e64a6ed23ffc6002932.zip FreeBSD-src-213e132f58cfb18b8eda2e64a6ed23ffc6002932.tar.gz |
One could be surprised how much bugs can still be found here...
Properlay clean the global RM variable if cgetstr() failed for it.
Otherwise, a connection attempt to a remote machine was made (and a
bogus result code printed) if a local printer followed a remote one in
printcap, and you did a `lpq -a', since checkremote() falsely assumed
the printer to be a remote one.
While i was at it, removed a gratuituous newline printed in front of
the remote machine's name, thus making the output more consistent (and
better machine-parseable) now.
Diffstat (limited to 'usr.sbin/lpr')
-rw-r--r-- | usr.sbin/lpr/common_source/displayq.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/lpr/common_source/displayq.c b/usr.sbin/lpr/common_source/displayq.c index 2903084..286fd82 100644 --- a/usr.sbin/lpr/common_source/displayq.c +++ b/usr.sbin/lpr/common_source/displayq.c @@ -114,7 +114,8 @@ displayq(format) ST = DEFSTAT; if (cgetnum(bp, "ct", &CT) < 0) CT = DEFTIMEOUT; - cgetstr(bp, "rm", &RM); + if (cgetstr(bp, "rm", &RM) < 0) + RM = NULL; if ((cp = checkremote())) printf("Warning: %s\n", cp); @@ -264,7 +265,7 @@ static void warn() { if (remote) - printf("\n%s: ", host); + printf("%s: ", host); puts("Warning: no daemon present"); current[0] = '\0'; } |