[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 01/27: src/preproc/html/pre-html.cpp: Rearrange function.
From: |
G. Branden Robinson |
Subject: |
[groff] 01/27: src/preproc/html/pre-html.cpp: Rearrange function. |
Date: |
Sat, 2 Jul 2022 00:43:06 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 949a4fa3e0d5827ff11467ddc14c6b2ed1db9268
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Jun 27 10:40:14 2022 -0500
src/preproc/html/pre-html.cpp: Rearrange function.
Relocate `do_file()` to precede `main()`, like every other function the
latter calls.
---
src/preproc/html/pre-html.cpp | 50 +++++++++++++++++++++----------------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp
index f15747f3..7631547a 100644
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -1808,6 +1808,31 @@ static int makeTempFiles(void)
return 0;
}
+static int do_file(const char *filename)
+{
+ FILE *fp;
+
+ current_filename = filename;
+ if (strcmp(filename, "-") == 0)
+ fp = stdin;
+ else {
+ fp = fopen(filename, "r");
+ if (fp == 0) {
+ error("can't open '%1': %2", filename, strerror(errno));
+ return 0;
+ }
+ }
+
+ if (inputFile.read_file(fp)) {
+ // XXX
+ }
+
+ if (fp != stdin)
+ fclose(fp);
+ current_filename = NULL;
+ return 1;
+}
+
int main(int argc, char **argv)
{
program_name = argv[0];
@@ -1868,31 +1893,6 @@ int main(int argc, char **argv)
return 0;
}
-static int do_file(const char *filename)
-{
- FILE *fp;
-
- current_filename = filename;
- if (strcmp(filename, "-") == 0)
- fp = stdin;
- else {
- fp = fopen(filename, "r");
- if (fp == 0) {
- error("can't open '%1': %2", filename, strerror(errno));
- return 0;
- }
- }
-
- if (inputFile.read_file(fp)) {
- // XXX
- }
-
- if (fp != stdin)
- fclose(fp);
- current_filename = NULL;
- return 1;
-}
-
// Local Variables:
// fill-column: 72
// mode: C++
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 01/27: src/preproc/html/pre-html.cpp: Rearrange function.,
G. Branden Robinson <=