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.
This commit is contained in:
parent
3529601895
commit
28185a1971
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=30437
@ -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';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user