Introduce a separate TU for utility functions util.c. Add a function
exec_cmd to simplify execution of system commands with error handling.
While at it, suppress a warning about unused result when executing a
shell command. As we only display the command's output we do not care
about the exit code.
This fixes Debian bug #398989[0]
[0]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=398989
Like less, w3m can use an input preprocessor when displaying files. The
preprocessor command is taken from the environment variable LESSOPEN.
The command line in LESSOPEN should include one occurrence of the string
"%s", which will be replaced by the filename when the input preprocessor
command is invoked. Giving more than one "%s" - or a any other
conversion specifier - will lead to undefined behaviour.
Add a check to make sure the command given has only one "%s".
This fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991608
w3m reads the history file on startup and writes it on exit. That means
if you open multiple instances of w3m, the history file will contain the
history of the last instance closed. All other history changes are lost.
Check if the modification time of the history file has changed before
writing. If it has changed read the history file from the disk into a
new history. Push the entries that are in the current history but not in
the history file into the new history and write the new history to disk.
GCC 12.2.0 on Arch reports:
.table.c: In function ???set_table_matrix0???:
.table.c:3536:5: error: ???__builtin_memset??? specified size between
18446744071562067969 and 18446744073709551615 exceeds maximum object
size 9223372036854775807 [-Werror=stringop-overflow=]
lto1: all warnings being treated as errors
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
child exited with value 1
make: *** [Makefile:132: w3m] Error 1
The function `unsigned char *MD5(const unsigned char *d, size_t n,
unsigned char *md)` from OpenSSL is deprecated and therefore generates
lots of warnings in the build when compiling against OpenSSL 3.0.
Do not treat these warnings as errors, but keep the warning active. This
should be reverted once OpenSSL-3.0 support arrives.
* Translating Documentation
* Create README.SSL from doc-jp
* Clarified wording on some functions
* Clarified English in README.img
* Created README.keymap
* Translated README.menu
* Minor grammar changes
With this fix combined with fix to libsixel:
https://github.com/saitoha/libsixel/pull/170
browsing on slow machines (e.g., when floating-point calculation is
emulated by kernel) gets significantly speed up.
Note that if i->cache->a_width (i->cache->a_height) is zero, width
(height) should be set to zero. Otherwise, image in screen boundary
(i.e., partially displayed) becomes strangely resized.