diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-09-09 21:34:52 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-09-10 11:43:01 +0200 |
commit | 4a4ffd9379ad247f0a303aa58d297c93dce0adcd (patch) | |
tree | 110c75621f1dea62e891f1a2fceb44ba2d1038ec /src/string-utils.h | |
parent | d54d6edc0cdd9f76e6bfdc8e5cfd4850ec5fc1a9 (diff) | |
download | sciteco-4a4ffd9379ad247f0a303aa58d297c93dce0adcd.tar.gz |
win32: convert command line to UTF-8 (refs #5)
* Should prevent data loss due to system locale conversions
when parsing command line arguments.
* Should also fix passing Unicode arguments to munged macros and
therefore opening files via ~/.teco_ini.
* The entire option parsing is based on GStrv (null-terminated string lists)
now, also on UNIX.
Diffstat (limited to 'src/string-utils.h')
-rw-r--r-- | src/string-utils.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/string-utils.h b/src/string-utils.h index efc6fc5..bb9ed37 100644 --- a/src/string-utils.h +++ b/src/string-utils.h @@ -35,6 +35,16 @@ teco_ascii_toupper(gchar chr) return chr >= 'a' && chr <= 'z' ? chr & ~0x20 : chr; } +static inline gchar * +teco_strv_remove(gchar **strv, guint i) +{ + gchar *ret = strv[i]; + do + strv[i] = strv[i+1]; + while (strv[++i]); + return ret; +} + /** * An 8-bit clean null-terminated string. * |