[HarfBuzz] harfbuzz: Branch 'master'
Behdad Esfahbod
behdad at kemper.freedesktop.org
Tue Nov 6 15:50:08 UTC 2018
util/options.cc | 4 +++-
util/options.hh | 2 ++
2 files changed, 5 insertions(+), 1 deletion(-)
New commits:
commit 3ec2e4fa7bec07ec181a0390e5f5fd695abee611
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Nov 6 10:49:19 2018 -0500
[util] Don't terminate string after a a 0 in -u
Fixes https://github.com/harfbuzz/harfbuzz/issues/1361
diff --git a/util/options.cc b/util/options.cc
index 5661cd05..3b22ca72 100644
--- a/util/options.cc
+++ b/util/options.cc
@@ -325,6 +325,7 @@ parse_text (const char *name G_GNUC_UNUSED,
return false;
}
+ text_opts->text_len = -1;
text_opts->text = g_strdup (arg);
return true;
}
@@ -370,6 +371,7 @@ parse_unicodes (const char *name G_GNUC_UNUSED,
s = p;
}
+ text_opts->text_len = gs->len;
text_opts->text = g_string_free (gs, FALSE);
return true;
}
@@ -729,7 +731,7 @@ text_options_t::get_line (unsigned int *len)
if (text) {
if (!line) line = text;
if (line_len == (unsigned int) -1)
- line_len = strlen (line);
+ line_len = text_len;
if (!line_len) {
*len = 0;
diff --git a/util/options.hh b/util/options.hh
index 6d57d7d6..0137484c 100644
--- a/util/options.hh
+++ b/util/options.hh
@@ -506,6 +506,7 @@ struct text_options_t : option_group_t
text_before = nullptr;
text_after = nullptr;
+ text_len = -1;
text = nullptr;
text_file = nullptr;
@@ -542,6 +543,7 @@ struct text_options_t : option_group_t
char *text_before;
char *text_after;
+ int text_len;
char *text;
char *text_file;
More information about the HarfBuzz
mailing list