Skip to content

Commit 1ddecb5

Browse files
committed
Fix ippfind output on Windows.
1 parent 7d54fc4 commit 1ddecb5

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

tools/ippfind.c

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,7 @@ eval_expr(ippfind_srv_t *service, // I - Service
10981098
ippfind_expr_t *expression; // Current expression
10991099
const char *val; // TXT value
11001100

1101+
11011102
// Loop through the expressions...
11021103
if (expressions && expressions->parent)
11031104
logic = expressions->parent->op;
@@ -1169,11 +1170,11 @@ eval_expr(ippfind_srv_t *service, // I - Service
11691170
result = list_service(service);
11701171
break;
11711172
case IPPFIND_OP_PRINT_NAME :
1172-
cupsLangPuts(stdout, service->name);
1173+
puts(service->name);
11731174
result = 1;
11741175
break;
11751176
case IPPFIND_OP_PRINT_URI :
1176-
cupsLangPuts(stdout, service->uri);
1177+
puts(service->uri);
11771178
result = 1;
11781179
break;
11791180
case IPPFIND_OP_QUIET :
@@ -1522,7 +1523,7 @@ list_service(ippfind_srv_t *service) // I - Service
15221523

15231524
if ((addrlist = httpAddrGetList(service->host, address_family, port)) == NULL)
15241525
{
1525-
cupsLangPrintf(stdout, "%s unreachable", service->uri);
1526+
printf("%s unreachable\n", service->uri);
15261527
return (0);
15271528
}
15281529

@@ -1555,7 +1556,7 @@ list_service(ippfind_srv_t *service) // I - Service
15551556

15561557
if (!http)
15571558
{
1558-
cupsLangPrintf(stdout, "%s unavailable", service->uri);
1559+
printf("%s unavailable\n", service->uri);
15591560
return (0);
15601561
}
15611562

@@ -1581,7 +1582,7 @@ list_service(ippfind_srv_t *service) // I - Service
15811582
// Show results...
15821583
if (cupsGetError() > IPP_STATUS_OK_EVENTS_COMPLETE)
15831584
{
1584-
cupsLangPrintf(stdout, "%s unavailable", service->uri);
1585+
printf("%s unavailable\n", service->uri);
15851586
return (0);
15861587
}
15871588

@@ -1613,7 +1614,7 @@ list_service(ippfind_srv_t *service) // I - Service
16131614
ippDelete(response);
16141615
httpClose(http);
16151616

1616-
cupsLangPrintf(stdout, "%s %s %s %s", service->uri, ippEnumString("printer-state", (int)pstate), paccepting ? "accepting-jobs" : "not-accepting-jobs", preasons);
1617+
printf("%s %s %s %s\n", service->uri, ippEnumString("printer-state", (int)pstate), paccepting ? "accepting-jobs" : "not-accepting-jobs", preasons);
16171618
}
16181619
else if (!strncmp(service->regtype, "_http._tcp", 10) || !strncmp(service->regtype, "_https._tcp", 11))
16191620
{
@@ -1628,13 +1629,13 @@ list_service(ippfind_srv_t *service) // I - Service
16281629

16291630
if (!http)
16301631
{
1631-
cupsLangPrintf(stdout, "%s unavailable", service->uri);
1632+
printf("%s unavailable\n", service->uri);
16321633
return (0);
16331634
}
16341635

16351636
if (!httpWriteRequest(http, "GET", service->resource))
16361637
{
1637-
cupsLangPrintf(stdout, "%s unavailable", service->uri);
1638+
printf("%s unavailable\n", service->uri);
16381639
return (0);
16391640
}
16401641

@@ -1649,11 +1650,11 @@ list_service(ippfind_srv_t *service) // I - Service
16491650

16501651
if (status >= HTTP_STATUS_BAD_REQUEST)
16511652
{
1652-
cupsLangPrintf(stdout, "%s unavailable", service->uri);
1653+
printf("%s unavailable\n", service->uri);
16531654
return (0);
16541655
}
16551656

1656-
cupsLangPrintf(stdout, "%s available", service->uri);
1657+
printf("%s available\n", service->uri);
16571658
}
16581659
else if (!strncmp(service->regtype, "_printer._tcp", 13))
16591660
{
@@ -1662,19 +1663,19 @@ list_service(ippfind_srv_t *service) // I - Service
16621663

16631664
if (!httpAddrConnect(addrlist, &sock, 30000, NULL))
16641665
{
1665-
cupsLangPrintf(stdout, "%s unavailable", service->uri);
1666+
printf("%s unavailable\n", service->uri);
16661667
httpAddrFreeList(addrlist);
16671668
return (0);
16681669
}
16691670

1670-
cupsLangPrintf(stdout, "%s available", service->uri);
1671+
printf("%s available\n", service->uri);
16711672
httpAddrFreeList(addrlist);
16721673

16731674
httpAddrClose(NULL, sock);
16741675
}
16751676
else
16761677
{
1677-
cupsLangPrintf(stdout, "%s unsupported", service->uri);
1678+
printf("%s unsupported\n", service->uri);
16781679
httpAddrFreeList(addrlist);
16791680
return (0);
16801681
}

0 commit comments

Comments
 (0)