]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
man pages: fix backslash-n in examples
authorDaniel Stenberg <daniel@haxx.se>
Thu, 4 Nov 2021 22:48:23 +0000 (23:48 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 5 Nov 2021 07:28:29 +0000 (08:28 +0100)
... to be proper backslash-backslash-n sequences to render nicely in man
and on website.

Follow-up to 24155569d8a
Reported-by: Sergey Markelov
Fixes https://github.com/curl/curl-www/issues/163
Closes #7962

20 files changed:
docs/libcurl/curl_easy_getinfo.3
docs/libcurl/curl_easy_option_by_id.3
docs/libcurl/curl_easy_option_by_name.3
docs/libcurl/curl_easy_option_next.3
docs/libcurl/curl_easy_strerror.3
docs/libcurl/curl_global_sslset.3
docs/libcurl/curl_mprintf.3
docs/libcurl/curl_multi_fdset.3
docs/libcurl/curl_multi_perform.3
docs/libcurl/curl_multi_remove_handle.3
docs/libcurl/curl_multi_strerror.3
docs/libcurl/curl_share_init.3
docs/libcurl/curl_share_setopt.3
docs/libcurl/curl_share_strerror.3
docs/libcurl/curl_strequal.3
docs/libcurl/curl_url_strerror.3
docs/libcurl/curl_version.3
docs/libcurl/curl_version_info.3
docs/libcurl/opts/CURLOPT_PREREQDATA.3
docs/libcurl/opts/CURLOPT_PREREQFUNCTION.3

index 251d9f265fd992b6a34306f93267487961763590..c3b68d9f32e7b9f456662e96375c3448f4f059f7 100644 (file)
@@ -295,7 +295,7 @@ transaction was started. So, this is zero if no redirection took place.
       res = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct);
 
       if((CURLE_OK == res) && ct)
-        printf("We received Content-Type: %s\n", ct);
+        printf("We received Content-Type: %s\\n", ct);
     }
 
     /* always cleanup */
index 23066ffc193cefa7d8211feeae10975d5360721f..cd213bdfae75a75ab1b2cb4cc7629e4512863124 100644 (file)
@@ -41,7 +41,7 @@ If libcurl has no option with the given id, this function returns NULL.
 .nf
 const struct curl_easyoption *opt = curl_easy_option_by_id(CURLOPT_URL);
 if(opt) {
-  printf("This option wants type %x\n", opt->type);
+  printf("This option wants type %x\\n", opt->type);
 }
 .fi
 .SH AVAILABILITY
index 34e0ef03fce63aef39390830f9ef7dcc0b6cd89d..40dee75e63f7303e8d8cd638300821611b1c6ef0 100644 (file)
@@ -39,7 +39,7 @@ If libcurl has no option with the given name, this function returns NULL.
 .nf
 const struct curl_easyoption *opt = curl_easy_option_by_name("URL");
 if(opt) {
-  printf("This option wants CURLoption %x\n", (int)opt->id);
+  printf("This option wants CURLoption %x\\n", (int)opt->id);
 }
 .fi
 .SH AVAILABILITY
index fdc9cf487d32830fc48a41cd76b486d87cd67043..33efef1507806702f2e81297088c7c974507f21f 100644 (file)
@@ -70,7 +70,7 @@ name is provided for backwards compatibility as an alias.
 const struct curl_easyoption *opt;
 opt = curl_easy_option_by_next(NULL);
 while(opt) {
-  printf("Name: %s\n", opt->name);
+  printf("Name: %s\\n", opt->name);
   opt = curl_easy_option_by_next(opt);
 }
 .fi
index 7b610441c23b8ad83430bffcb4b2ba57bef43faf..20f8aa363b0d0ebd054b7c3a2d521b024dd32d0a 100644 (file)
@@ -38,7 +38,7 @@ specific error descriptions generated at run-time.
   res = curl_easy_perform(curl);
   /* Check for errors */
   if(res != CURLE_OK)
-    fprintf(stderr, "curl_easy_perform() failed: %s\n",
+    fprintf(stderr, "curl_easy_perform() failed: %s\\n",
             curl_easy_strerror(res));
 .fi
 .SH AVAILABILITY
index 23abaf5a56f0507929b23c0abf778483314a89df..02b74f967b60ee84210e2231a2eb19fba76893a2 100644 (file)
@@ -92,7 +92,7 @@ This doesn't just mean no other thread that is using libcurl.
   curl_global_sslset((curl_sslbackend)-1, NULL, &list);
 
   for(i = 0; list[i]; i++)
-    printf("SSL backend #%d: '%s' (ID: %d)\n",
+    printf("SSL backend #%d: '%s' (ID: %d)\\n",
            i, list[i]->name, list[i]->id);
 .fi
 .SH AVAILABILITY
index 393072558ead0780df605f43e8de86960957faa1..6cc39f9367bd4ee59686359317a0e4b44de72acf 100644 (file)
@@ -241,8 +241,8 @@ by the corresponding argument.
 A '%' is written. No argument is converted.
 .SH EXAMPLE
 .nf
-  mprintf("My name is %s\n", name);
-  mprintf("Pi is almost %f\n", 25/8);
+  mprintf("My name is %s\\n", name);
+  mprintf("Pi is almost %f\\n", 25/8);
 .fi
 .SH AVAILABILITY
 These functions will be removed from the public libcurl API in the future. Do
index f189115a20321386a48394eed9163fdfbc938c41..5cfa7f146e36935e17f1cecc53ff11891fc73f47 100644 (file)
@@ -81,7 +81,7 @@ for...
  mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
 
  if(mc != CURLM_OK) {
-   fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc);
+   fprintf(stderr, "curl_multi_fdset() failed, code %d.\\n", mc);
    break;
  }
 
index aeb346eb1597cac8256650e94df29f8dd868bed5..edd18d1e98c5b4adc565eab60126207426274014 100644 (file)
@@ -63,7 +63,7 @@ do {
     mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL);
 
   if(mc) {
-    fprintf(stderr, "curl_multi_poll() failed, code %d.\n", (int)mc);
+    fprintf(stderr, "curl_multi_poll() failed, code %d.\\n", (int)mc);
     break;
   }
 
index 2d18527172d34fab161c96fd717baa44e90c67fb..e4101a6b14631adb475f07853a69fc3a0fee0fd2 100644 (file)
@@ -47,7 +47,7 @@ msg = curl_multi_info_read(multi_handle, &queued);
 if(msg) {
   if(msg->msg == CURLMSG_DONE) {
     /* a transfer ended */
-    fprintf(stderr, "Transfer completed\n");
+    fprintf(stderr, "Transfer completed\\n");
     curl_multi_remove_handle(multi_handle, msg->easy_handle);
   }
 }
index 4ab4cacaabfe496bc6d458f70b1c3db83322b6b4..82dc22aa78cc030c8111cb41ffc1fa9b0011efe7 100644 (file)
@@ -35,7 +35,7 @@ int still_running;
 
 CURLMcode mc = curl_multi_perform(multi_handle, &still_running);
 if(mc)
-  printf("error: %s\n", curl_multi_strerror(mc));
+  printf("error: %s\\n", curl_multi_strerror(mc));
 .fi
 .SH AVAILABILITY
 This function was added in libcurl 7.12.0
index 4bca9d3d3eea11242825d90a2e7db9a8f141f330..ad0b348afffff27b5ad593e48ea68d2e3bcb2203 100644 (file)
@@ -42,7 +42,7 @@ specific curl handle use the data in this share.
   share = curl_share_init();
   sh = curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT);
   if(sh)
-    printf("Error: %s\n", curl_share_strerror(sh));
+    printf("Error: %s\\n", curl_share_strerror(sh));
 .fi
 .SH AVAILABILITY
 Added in 7.10
index a5accc5aff441b239dc0ae4d9719ec8ac7f7c364..35be8aeedd42b77d742aab1bc85fc3e2bf6652a9 100644 (file)
@@ -112,7 +112,7 @@ to the lock_function and unlock_function each time it is called.
   share = curl_share_init();
   sh = curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT);
   if(sh)
-    printf("Error: %s\n", curl_share_strerror(sh));
+    printf("Error: %s\\n", curl_share_strerror(sh));
 .fi
 .SH AVAILABILITY
 Added in 7.10
index 6e1c6d06f8b6c05ba93bb8d915f35e178fc4f062..08a9dba299e60fc7b60e81270cdfc339c5a6bc9c 100644 (file)
@@ -35,7 +35,7 @@ error code passed in the argument \fIerrornum\fP.
   share = curl_share_init();
   sh = curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT);
   if(sh)
-    printf("Error: %s\n", curl_share_strerror(sh));
+    printf("Error: %s\\n", curl_share_strerror(sh));
 .fi
 .SH AVAILABILITY
 This function was added in libcurl 7.12.0
index 3d8f2d59381b6551a0d15c0d5c666768fe0f587a..8fc6b94848e141479f9d0a6d392b2538acbb7ea8 100644 (file)
@@ -44,9 +44,9 @@ insensitive string comparison functions. These two work on all platforms.
 .SH EXAMPLE
 .nf
 if(curl_strequal(name, input))
-  printf("Name and input matches\n");
+  printf("Name and input matches\\n");
 if(curl_strnequal(name, input, 5))
-  printf("Name and input matches in the 5 first bytes\n");
+  printf("Name and input matches in the 5 first bytes\\n");
 .fi
 .SH AVAILABILITY
 These functions will be removed from the public libcurl API in a near
index 975193ff1529d1a9b00b7c90069f6f32c109fdf0..0ba03cf0a335b8226ee72feb68eaa5549936bb36 100644 (file)
@@ -35,7 +35,7 @@ error code passed in the argument \fIerrornum\fP.
   CURLU *url = curl_url();
   rc = curl_url_set(url, CURLUPART_URL, "https://example.com", 0);
   if(rc)
-    printf("URL error: %s\n", curl_url_strerror(rc));
+    printf("URL error: %s\\n", curl_url_strerror(rc));
   curl_url_cleanup(url);
 .fi
 
index c907d97a7878f7487020b601c2209bf3704d95d2..58c08c0cf52d1ebd5099514282cd0f8930604c2f 100644 (file)
@@ -34,7 +34,7 @@ its important components (like OpenSSL version).
 We recommend using \fIcurl_version_info(3)\fP instead!
 .SH EXAMPLE
 .nf
-printf("libcurl version %s\n", curl_version());
+printf("libcurl version %s\\n", curl_version());
 .fi
 
 .SH AVAILABILITY
index b8e2f393e588e480fbce59a3a1d8ca726f3c1c9b..c388bb3c9a0acf861c1731d304417b4fe59d8610 100644 (file)
@@ -226,7 +226,7 @@ entry.
 .SH EXAMPLE
 .nf
 curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
-printf("libcurl version %u.%u.%u\n",
+printf("libcurl version %u.%u.%u\\n",
        (ver->version_num >> 16) & 0xff,
        (ver->version_num >> 8) & 0xff,
        ver->version_num & 0xff,
index 07497a83bc801e9c036880ae67483dfbeae4c47e..4ccc07109a5da2b0971519922f224c7fe02d56c8 100644 (file)
@@ -43,7 +43,7 @@ static int prereq_callback(void *clientp,
                            int conn_primary_port,
                            int conn_local_port)
 {
-  printf("Connection made to %s:%s\n", conn_primary_ip, conn_primary_port);
+  printf("Connection made to %s:%s\\n", conn_primary_ip, conn_primary_port);
   return CURL_PREREQFUNC_OK;
 }
 
index dcc782f9d95548a978d09ec2a90f3c21f15fade8..50a4adf355f9e6959ca4f8e2b982de9df6687824 100644 (file)
@@ -86,7 +86,7 @@ static int prereq_callback(void *clientp,
                            int conn_primary_port,
                            int conn_local_port)
 {
-  printf("Connection made to %s:%s\n", conn_primary_ip, conn_primary_port);
+  printf("Connection made to %s:%s\\n", conn_primary_ip, conn_primary_port);
   return CURL_PREREQFUNC_OK;
 }