gbranden pushed a commit to branch master
in repository groff.
commit 38046454d87c66434c4ba6b2248fabb554a797d3
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Nov 4 02:06:19 2025 -0600
[libgroff]: Trivially refactor.
Rename `open_file_cautious()` function to `open_file_cautiously()`.
* src/include/searchpath.h (class search_path): Do it.
* src/libs/libgroff/searchpath.cpp
(search_path::open_file_cautious): Rename this...
(search_path::open_file_cautiously): ...to this.
* src/devices/grops/psrm.cpp (resource_manager::supply_resource):
* src/preproc/soelim/soelim.cpp (do_file):
* src/roff/troff/input.cpp (next_file)
(do_source)
(psbb_locator::psbb_locator)
(transparent_throughput_file_request)
(process_input_file):
* src/roff/troff/node.cpp (troff_output_file::really_copy_file): Update
call sites.
---
ChangeLog | 20 ++++++++++++++++++++
src/devices/grops/psrm.cpp | 2 +-
src/include/searchpath.h | 2 +-
src/libs/libgroff/searchpath.cpp | 4 ++--
src/preproc/soelim/soelim.cpp | 2 +-
src/roff/troff/input.cpp | 10 +++++-----
src/roff/troff/node.cpp | 2 +-
7 files changed, 31 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1fde2e803..e0841941b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2025-11-04 G. Branden Robinson <[email protected]>
+
+ [libgroff]: Trivially refactor. Rename `open_file_cautious()`
+ function to `open_file_cautiously()`.
+
+ * src/include/searchpath.h (class search_path): Do it.
+ * src/libs/libgroff/searchpath.cpp
+ (search_path::open_file_cautious): Rename this...
+ (search_path::open_file_cautiously): ...to this.
+ * src/devices/grops/psrm.cpp
+ (resource_manager::supply_resource):
+ * src/preproc/soelim/soelim.cpp (do_file):
+ * src/roff/troff/input.cpp (next_file)
+ (do_source)
+ (psbb_locator::psbb_locator)
+ (transparent_throughput_file_request)
+ (process_input_file):
+ * src/roff/troff/node.cpp (troff_output_file::really_copy_file):
+ Update call sites.
+
2025-11-03 G. Branden Robinson <[email protected]>
* src/roff/groff/groff.cpp (main): Update copyright notice
diff --git a/src/devices/grops/psrm.cpp b/src/devices/grops/psrm.cpp
index 5957d0dd9..fad55e082 100644
--- a/src/devices/grops/psrm.cpp
+++ b/src/devices/grops/psrm.cpp
@@ -347,7 +347,7 @@ void resource_manager::supply_resource(resource *r, int
rank,
}
}
else {
- fp = include_search_path.open_file_cautious(r->filename);
+ fp = include_search_path.open_file_cautiously(r->filename);
if (0 /* nullptr */ == fp) {
error("cannot open PostScript resource file '%1': %2",
r->filename, strerror(errno));
diff --git a/src/include/searchpath.h b/src/include/searchpath.h
index 88829c68b..c6e97757e 100644
--- a/src/include/searchpath.h
+++ b/src/include/searchpath.h
@@ -25,7 +25,7 @@ public:
~search_path();
void command_line_dir(const char *);
FILE *open_file(const char *, char **);
- FILE *open_file_cautious(const char *, char ** = 0, const char * = 0);
+ FILE *open_file_cautiously(const char *, char ** = 0, const char * = 0);
};
// Local Variables:
diff --git a/src/libs/libgroff/searchpath.cpp b/src/libs/libgroff/searchpath.cpp
index d5c02ed3f..0e41c7268 100644
--- a/src/libs/libgroff/searchpath.cpp
+++ b/src/libs/libgroff/searchpath.cpp
@@ -172,8 +172,8 @@ FILE *search_path::open_file(const char *name, char **pathp)
return 0 /* nullptr */;
}
-FILE *search_path::open_file_cautious(const char *name, char **pathp,
- const char *mode)
+FILE *search_path::open_file_cautiously(const char *name, char **pathp,
+ const char *mode)
{
if (0 /* nullptr */ == mode)
mode = "r";
diff --git a/src/preproc/soelim/soelim.cpp b/src/preproc/soelim/soelim.cpp
index 9ada7563e..311e7c429 100644
--- a/src/preproc/soelim/soelim.cpp
+++ b/src/preproc/soelim/soelim.cpp
@@ -189,7 +189,7 @@ void do_so(const char *line)
int do_file(const char *filename)
{
char *file_name_in_path = 0;
- FILE *fp = include_search_path.open_file_cautious(filename,
+ FILE *fp = include_search_path.open_file_cautiously(filename,
&file_name_in_path);
int err = errno;
string whole_filename(filename);
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index a1367a30b..9bb3c1d10 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -931,7 +931,7 @@ void next_file()
input_stack::end_file();
else {
errno = 0;
- FILE *fp = include_search_path.open_file_cautious(filename);
+ FILE *fp = include_search_path.open_file_cautiously(filename);
if (0 /* nullptr */ == fp)
error("cannot open '%1': %2", filename, strerror(errno));
else
@@ -7124,7 +7124,7 @@ void do_source(bool quietly)
{
char *filename = read_rest_of_line_as_argument();
errno = 0;
- FILE *fp = include_search_path.open_file_cautious(filename);
+ FILE *fp = include_search_path.open_file_cautiously(filename);
if (fp != 0 /* nullptr */)
input_stack::push(new file_iterator(fp, filename));
else
@@ -7274,7 +7274,7 @@ filename(fname), llx(0), lly(0), urx(0), ury(0),
lastc(EOF)
// PS files might contain non-printable characters, such as ^Z
// and CRs not followed by an LF, so open them in binary mode.
//
- fp = include_search_path.open_file_cautious(filename, 0, FOPEN_RB);
+ fp = include_search_path.open_file_cautiously(filename, 0, FOPEN_RB);
if (fp != 0 /* nullptr */) {
// After successfully opening the file, acquire the first
// line, whence we may determine the file format...
@@ -9140,7 +9140,7 @@ static void transparent_throughput_file_request()
curenv->do_break();
if (filename != 0 /* nullptr */) {
errno = 0;
- FILE *fp = include_search_path.open_file_cautious(filename);
+ FILE *fp = include_search_path.open_file_cautiously(filename);
if (0 /* nullptr */ == fp)
error("cannot open '%1': %2", filename, strerror(errno));
else {
@@ -9358,7 +9358,7 @@ static void process_input_file(const char *name)
}
else {
errno = 0;
- fp = include_search_path.open_file_cautious(name);
+ fp = include_search_path.open_file_cautiously(name);
if (0 /* nullptr */ == fp)
fatal("cannot open '%1': %2", name, strerror(errno));
}
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 5eeb62e75..f5f20987a 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -1628,7 +1628,7 @@ void troff_output_file::really_copy_file(hunits x, vunits
y,
flush_tbuf();
do_motion();
errno = 0;
- FILE *ifp = include_search_path.open_file_cautious(filename);
+ FILE *ifp = include_search_path.open_file_cautiously(filename);
if (0 /* nullptr */ == ifp)
error("cannot open '%1': %2", filename, strerror(errno));
else {
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit