Skip to content

Commit 4bce6ed

Browse files
committed
formatting
1 parent 6cb052a commit 4bce6ed

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

src/tldr.c

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ char const* _gethome(void);
8989
/* Output */
9090
int construct_url(char* buf, size_t buflen, char const* input,
9191
char const* platform);
92-
int construct_path(char* buf, size_t buflen, char const* home, char const* input,
92+
int construct_path(char* buf, size_t buflen, char const* home,
93+
char const* input,
9394
char const* platform);
9495
int parse_tldrpage(char const* input);
9596
int print_tldrpage(char const* input, char const* platform);
@@ -176,7 +177,7 @@ main(int argc, char** argv)
176177
pbuf[len] = '\0';
177178
platform_flag = 1;
178179
}
179-
break;
180+
break;
180181

181182
default:
182183
abort();
@@ -236,7 +237,8 @@ main(int argc, char** argv)
236237
if (print_tldrpage(buf, pbuf[0] != 0 ? pbuf : NULL))
237238
{
238239
fprintf(stdout, "This page doesn't exist yet!\n");
239-
fprintf(stdout, "Submit new pages here: https://github.com/tldr-pages/tldr\n");
240+
fprintf(stdout,
241+
"Submit new pages here: https://github.com/tldr-pages/tldr\n");
240242
return EXIT_FAILURE;
241243
}
242244
}
@@ -245,7 +247,8 @@ main(int argc, char** argv)
245247
}
246248

247249
int
248-
construct_url(char* buf, size_t buflen, char const* input, char const* platform)
250+
construct_url(char* buf, size_t buflen, char const* input,
251+
char const* platform)
249252
{
250253
size_t baselen;
251254
size_t delimlen;
@@ -411,9 +414,9 @@ print_tldrpage(char const* input, char const* poverride)
411414
{
412415
platform = poverride;
413416
if (strcmp(platform, "linux") != 0
414-
&& strcmp(platform, "osx") != 0
415-
&& strcmp(platform, "common") != 0
416-
&& strcmp(platform, "sunos") != 0)
417+
&& strcmp(platform, "osx") != 0
418+
&& strcmp(platform, "common") != 0
419+
&& strcmp(platform, "sunos") != 0)
417420
{
418421
fprintf(stderr, "Error: platform %s is unsupported\n", platform);
419422
fprintf(stderr, "Supported platforms: linux / osx / sunos / common\n");
@@ -478,7 +481,8 @@ print_version(char const* arg)
478481
{
479482
fprintf(stdout, "%s %s\n", arg, VERSION_PRETTY);
480483
fprintf(stdout, "Copyright (C) 2016 Arvid Gerstmann\n");
481-
fprintf(stdout, "Source available at https://github.com/tldr-pages/tldr-cpp-client\n");
484+
fprintf(stdout,
485+
"Source available at https://github.com/tldr-pages/tldr-cpp-client\n");
482486
}
483487

484488
void
@@ -489,9 +493,11 @@ print_usage(char const* arg)
489493
fprintf(stdout, "available commands:\n");
490494
fprintf(stdout, " %-20s %-30s\n", "-v", "print verbose output");
491495
fprintf(stdout, " %-20s %-30s\n", "--version", "print version and exit");
492-
fprintf(stdout, " %-20s %-30s\n", "-h, --help", "print this help and exit");
496+
fprintf(stdout, " %-20s %-30s\n", "-h, --help",
497+
"print this help and exit");
493498
fprintf(stdout, " %-20s %-30s\n", "-u, --update", "update local database");
494-
fprintf(stdout, " %-20s %-30s\n", "-c, --clear-cache", "clear local database");
499+
fprintf(stdout, " %-20s %-30s\n", "-c, --clear-cache",
500+
"clear local database");
495501
fprintf(stdout, " %-20s %-30s\n", "-p, --platform=<platform>",
496502
"select platform, supported are linux / osx / sunos / common");
497503
}
@@ -690,7 +696,7 @@ clear_localdb(int verbose)
690696
if (homedir == NULL) { return 1; }
691697

692698
homedirlen = strlen(homedir);
693-
if ((homedirlen + TLDR_HOME_LEN + 1) > 255)
699+
if ((homedirlen + TLDR_HOME_LEN + 1) > 255)
694700
{ return 1; }
695701

696702
memcpy(tmp, homedir, homedirlen);
@@ -939,7 +945,7 @@ progress_callback(void* clientp, curl_off_t dltotal, curl_off_t dlnow,
939945

940946
int
941947
old_progress_callback(void* p, double dltotal, double dlnow,
942-
double ultotal, double ulnow)
948+
double ultotal, double ulnow)
943949
{
944950
return progress_callback(p, (curl_off_t)dltotal, (curl_off_t)dlnow,
945951
(curl_off_t)ultotal, (curl_off_t)ulnow);
@@ -1086,4 +1092,3 @@ download_content(char const* url, char** out, int verbose)
10861092
*out = NULL;
10871093
return 1;
10881094
}
1089-

0 commit comments

Comments
 (0)