mirror of
https://github.com/curl/curl.git
synced 2025-02-11 14:50:40 +08:00
opts: fix bad example formatting \n => \\n
...to render properly nroff.
This commit is contained in:
parent
271c63748a
commit
289236b223
@ -55,7 +55,7 @@ if(curl) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_ACTIVESOCKET, &sockfd);
|
||||
|
||||
if(res != CURLE_OK) {
|
||||
printf("Error: %s\n", curl_easy_strerror(res));
|
||||
printf("Error: %s\\n", curl_easy_strerror(res));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -57,13 +57,13 @@ if(curl) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &ci);
|
||||
|
||||
if (!res) {
|
||||
printf("%d certs!\n", ci->num_of_certs);
|
||||
printf("%d certs!\\n", ci->num_of_certs);
|
||||
|
||||
for(i = 0; i < ci->num_of_certs; i++) {
|
||||
struct curl_slist *slist;
|
||||
|
||||
for(slist = ci->certinfo[i]; slist; slist = slist->next)
|
||||
printf("%s\n", slist->data);
|
||||
printf("%s\\n", slist->data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ if(curl) {
|
||||
long unmet;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &unmet);
|
||||
if(!res) {
|
||||
printf("The time condition was %sfulfilled\n", unmet?"NOT":"");
|
||||
printf("The time condition was %sfulfilled\\n", unmet?"NOT":"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ if(curl) {
|
||||
double cl;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &cl);
|
||||
if(!res) {
|
||||
printf("Size: %.0f\n", cl);
|
||||
printf("Size: %.0f\\n", cl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ if(curl) {
|
||||
double cl;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &cl);
|
||||
if(!res) {
|
||||
printf("Size: %.0f\n", cl);
|
||||
printf("Size: %.0f\\n", cl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ if(curl) {
|
||||
char *ct = NULL;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct);
|
||||
if(!res && ct) {
|
||||
printf("Content-Type: %s\n", ct);
|
||||
printf("Content-Type: %s\\n", ct);
|
||||
}
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
|
@ -51,7 +51,7 @@ if(curl) {
|
||||
char *ep = NULL;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_FTP_ENTRY_PATH, &ep);
|
||||
if(!res && ep) {
|
||||
printf("Entry path was: %s\n", ep);
|
||||
printf("Entry path was: %s\\n", ep);
|
||||
}
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
|
@ -46,7 +46,7 @@ if(curl) {
|
||||
long size;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &size);
|
||||
if(!res)
|
||||
printf("Header size: %ld bytes\n", size);
|
||||
printf("Header size: %ld bytes\\n", size);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
@ -48,9 +48,9 @@ if(curl) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_HTTPAUTH_AVAIL, &auth);
|
||||
if(!res) {
|
||||
if(!auth)
|
||||
printf("No auth available, perhaps no 401?\n");
|
||||
printf("No auth available, perhaps no 401?\\n");
|
||||
else {
|
||||
printf("%s%s%s%s\n",
|
||||
printf("%s%s%s%s\\n",
|
||||
auth & CURLAUTH_BASIC ? "Basic ":"",
|
||||
auth & CURLAUTH_DIGEST ? "Digest ":"",
|
||||
auth & CURLAUTH_NEGOTIATE ? "Negotiate ":"",
|
||||
|
@ -47,7 +47,7 @@ if(curl) {
|
||||
long code;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_HTTP_CONNECTCODE, &code);
|
||||
if(!res && code)
|
||||
printf("The CONNECT response code: %03ld\n", code);
|
||||
printf("The CONNECT response code: %03ld\\n", code);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ if(curl) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_LASTSOCKET, &sockfd);
|
||||
|
||||
if(res != CURLE_OK) {
|
||||
printf("Error: %s\n", curl_easy_strerror(res));
|
||||
printf("Error: %s\\n", curl_easy_strerror(res));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ if(curl) {
|
||||
long connects;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_NUM_CONNECTS, &connects);
|
||||
if(res)
|
||||
printf("It needed %d connects\n", connects);
|
||||
printf("It needed %d connects\\n", connects);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ if(curl) {
|
||||
long port;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_PRIMARY_PORT, &port);
|
||||
if(!res)
|
||||
printf("Connected to remote port: %ld\n", port);
|
||||
printf("Connected to remote port: %ld\\n", port);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ if(curl) {
|
||||
long req;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_REQUEST_SIZE, &req);
|
||||
if(!res)
|
||||
printf("Request size: %ld bytes\n", req);
|
||||
printf("Request size: %ld bytes\\n", req);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ if(curl) {
|
||||
double dl;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD, &dl);
|
||||
if(!res) {
|
||||
printf("Downloaded %.0f bytes\n", cl);
|
||||
printf("Downloaded %.0f bytes\\n", cl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ if(curl) {
|
||||
double ul;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SIZE_UPLOAD, &ul);
|
||||
if(!res) {
|
||||
printf("Uploaded %.0f bytes\n", ul);
|
||||
printf("Uploaded %.0f bytes\\n", ul);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ if(curl) {
|
||||
double speed;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD, &speed);
|
||||
if(!res) {
|
||||
printf("Download speed %.0f bytes/sec\n", ul);
|
||||
printf("Download speed %.0f bytes/sec\\n", ul);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ if(curl) {
|
||||
double speed;
|
||||
res = curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD, &speed);
|
||||
if(!res) {
|
||||
printf("Upload speed %.0f bytes/sec\n", ul);
|
||||
printf("Upload speed %.0f bytes/sec\\n", ul);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 30L);
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OPERATION_TIMEDOUT == res) {
|
||||
printf("Timeout!\n");
|
||||
printf("Timeout!\\n");
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
|
@ -45,7 +45,7 @@ if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 30L);
|
||||
res = curl_easy_perform(curl);
|
||||
if(CURLE_OPERATION_TIMEDOUT == res) {
|
||||
printf("Timeout!\n");
|
||||
printf("Timeout!\\n");
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
|
Loading…
Reference in New Issue
Block a user