[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 04/07: [grotty]: Fix code style nit.
From: |
G. Branden Robinson |
Subject: |
[groff] 04/07: [grotty]: Fix code style nit. |
Date: |
Sat, 2 Oct 2021 14:14:27 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 806e6b31883308f9468b0092196a3ee2882528fc
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Oct 3 03:37:56 2021 +1100
[grotty]: Fix code style nit.
* src/devices/grotty/tty.cpp (tty_printer:special_link): Tighten code
slightly by taking advantage of preprocessor string literal
concatenation.
Also fix mis-description of OSC 8 output format in comment.
---
ChangeLog | 6 ++++++
src/devices/grotty/tty.cpp | 6 ++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 02becbd..ca21e3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-10-03 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * src/devices/grotty/tty.cpp (tty_printer:special_link): Tighten
+ code slightly by taking advantage of preprocessor string literal
+ concatenation.
+
2021-10-01 G. Branden Robinson <g.branden.robinson@gmail.com>
[man]: Fix `U` enablement override so it actually works the way
diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp
index bd295a7..3995917 100644
--- a/src/devices/grotty/tty.cpp
+++ b/src/devices/grotty/tty.cpp
@@ -461,7 +461,7 @@ void tty_printer::special(char *arg, const environment
*env, char type)
// Produce an OSC 8 hyperlink. Given ditroff input of the form:
// x X tty: link [URI[ KEY=VALUE] ...]
-// produce "OSC 8 [;KEY=VALUE:]...;[URI]; ST ". KEY/VALUE pairs can be
+// produce "OSC 8 [;KEY=VALUE];[URI] ST ". KEY/VALUE pairs can be
// repeated arbitrarily and are separated by colons. Omission of the
// URI ends the hyperlink that was begun by specifying it. See
// <https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda>.
@@ -487,9 +487,7 @@ void tty_printer::special_link(const char *arg, const
environment *env)
warning("new hyperlink started without ending previous one;"
" recovering");
simple_add_char(';', env);
- for (const char *s = ST; *s != '\0'; s++)
- simple_add_char(*s, env);
- for (const char *s = OSC8; *s != '\0'; s++)
+ for (const char *s = ST OSC8; *s != '\0'; s++)
simple_add_char(*s, env);
simple_add_char(';', env);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 04/07: [grotty]: Fix code style nit.,
G. Branden Robinson <=