1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-28 01:35:32 +00:00
Commit Graph

50 Commits

Author SHA1 Message Date
Witold Filipczyk
c15dc0da66 [mailcap] Fix in test. Refs #241
mailcap test failed on s390x arch.
Better fix would require much more elinks code included in this test.
For example call to register_options(...).
2023-06-28 12:19:38 +02:00
Witold Filipczyk
a67188413c [lists] LIST_HEAD -> LIST_HEAD_EL to not clash with libevent's LIST_HEAD. Also added curl implementation of ftpes and sftp
Implementation of ftpes and sftp is based on curl's hiperfifo example. It requires libevent.
ftpes only encrypts control channel. There were problems when both control and data were encrypted. It stucked on SIZE.
Only successful connections work, errors are not handled properly.
2023-06-19 18:43:53 +02:00
Witold Filipczyk
7ea04c7f0f [isspace] Some implementations of isspace require unsigned char 2022-06-28 20:25:06 +02:00
Witold Filipczyk
3d1280fd2a [mailcap] Fixed tests 2022-06-05 15:29:04 +02:00
Witold Filipczyk
2c2cf97e03 [options] No need for C_ macro in INIT_OPT_* 2022-03-02 19:02:47 +01:00
Witold Filipczyk
95bd39ff72 [mailcap] explicit cast to char * 2022-02-21 16:30:42 +01:00
Witold Filipczyk
3ca726ac98 [mime] cast 2022-01-25 18:25:58 +01:00
Witold Filipczyk
2fa67c5730 [char] Introduced macro C_
C_("aaaa") -> (char *)("aaaa")
2022-01-19 22:49:13 +01:00
Witold Filipczyk
de2a787900 [strstr] no cast 2022-01-18 20:55:08 +01:00
Witold Filipczyk
53a860a3d6 [strchr] casting first parameter to const char * was not a good idea 2022-01-18 20:30:48 +01:00
Witold Filipczyk
881f896e85 [mem_calloc] Cast 2022-01-16 21:08:50 +01:00
Witold Filipczyk
20c161559c [mem_alloc] cast return value 2022-01-16 19:09:27 +01:00
Witold Filipczyk
b434b11309 [options] 0 (option_flags) -> OPT_ZERO 2022-01-15 20:10:37 +01:00
Witold Filipczyk
66305fcb50 [gettext] try system gettext. Refs #62
Now, only meson was changed.
-Dnls=true -Dgettext=true
2021-08-08 21:25:08 +02:00
Witold Filipczyk
0fea79cc8f [cflags] Removed -Wno-pointer-sign
Likely some new bugs were introduced by this change.
The long term goal is clean compilation by g++.
2021-01-02 16:20:27 +01:00
sgerwk
d6ccb1813b update the "What to do?" dialog to the new format with %f for the file 2020-09-13 17:23:51 +02:00
Witold Filipczyk
3d96b0d7d7 Revert "Compile with C++."
This reverts commit 4f4df33638.
2019-04-21 12:27:40 +02:00
Witold Filipczyk
4f4df33638 Compile with C++.
Weak points:
- alignof
- js problems

Todo:
- make js work with C++ and mozjs-17
- then mozjs-24
- then mozjs-52
- then mozjs-60
- decrease number of warnings
2019-02-17 20:46:16 +01:00
أحمد المحمودي (Ahmed El-Mahmoudy)
dbab898f38 Fix spelling mistakes 2019-01-14 04:51:10 +01:00
Arjen Stolk
e957e60d5c mailcap: prevent segfault on test entry with %s
When a mailcap entry with a testcommand containing %s is encountered, it is ignored. The
entry was freed, but not set to NULL, leading to a segfault later on.
2016-12-28 14:22:01 +01:00
Witold Filipczyk
96e65c105f Explicit cast in strstr for C++ 2016-04-20 20:46:33 +02:00
Witold Filipczyk
52d6f37c8e Explicit cast to (const char *) for strchr function (C++) 2016-04-20 19:43:37 +02:00
Kalle Olavi Niemitalo
8b00e1ef70 bug 764: Initialize the right member of union option_value
INIT_OPTION used to initialize union option_value at compile time by
casting the default value to LIST_OF(struct option) *, which is the
type of the first member.  On sparc64 and other big-endian systems
where sizeof(int) < sizeof(struct list_head *), this tended to leave
option->value.number as zero, thus messing up OPT_INT and OPT_BOOL
at least.  OPT_LONG however tended to work right.

This would be easy to fix with C99 designated initializers,
but doc/hacking.txt says ELinks must be kept C89 compatible.
Another solution would be to make register_options() read the
value from option->value.tree (the first member), cast it back
to the right type, and write it to the appropriate member;
but that would still require somewhat dubious conversions
between integers, data pointers, and function pointers.

So here's a rather more invasive solution.  Add struct option_init,
which is somewhat similar to struct option but has non-overlapping
members for different types of values, to ensure nothing is lost
in compile-time conversions.  Move unsigned char *path from struct
option_info to struct option_init, and replace struct option_info
with a union that contains struct option_init and struct option.
Now, this union can be initialized with no portability problems,
and register_options() then moves the values from struct option_init
to their final places in struct option.

In my x86 ELinks build with plenty of options configured in, this
change bloated the text section by 340 bytes but compressed the data
section by 2784 bytes, presumably because union option_info is a
pointer smaller than struct option_info was.
(cherry picked from elinks-0.12 commit e5f6592ee2)

Conflicts:
	src/protocol/fsp/fsp.c: All options had been removed in 0.13.GIT.
	src/protocol/smb/smb2.c: Ditto.
2012-11-03 22:16:32 +02:00
Kalle Olavi Niemitalo
9e4d7d1883 mailcap bug 1113: Don't leak values of duplicate fields
If a mailcap entry has two test commands or two descriptions,
free the first one before replacing it with the second one.
2011-04-17 21:26:08 +03:00
Witold Filipczyk
7dfb20d11f Handle mailcap's copiousoutput without an external pager.
I tested it only on local PDFs.
I don't know if temporary files are deleted or not.
2010-07-24 17:07:18 +02:00
Kalle Olavi Niemitalo
1bb71f3732 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	src/config/conf.c
	src/network/ssl/ssl.c
2009-03-12 08:46:02 +02:00
Kalle Olavi Niemitalo
5a43c55c9e Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line.  When the option manager displayed these
strings, it treated each "\n" as a hard newline.  On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones.  This could also cause the text to take up too much
vertical space and not fit in the window.

Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping.  At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.

In some options though, there is a list of possible values and their
meanings.  In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented.  The
option manager and BFU are not currently able to do that.  So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-08 15:18:10 +02:00
Kalle Olavi Niemitalo
5c2fada371 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	src/session/download.c
2008-11-01 22:39:17 +02:00
M. Vefa Bicakci
96b3093519 Patch 2: Modifications to the remaining parts of ELinks
[Forward ported to 0.12 from bug 1004 attachment 499.  --KON]
2008-11-01 22:20:25 +02:00
Kalle Olavi Niemitalo
5b6c913c6a Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	src/network/connection.h
	src/session/download.c
	src/session/download.h
2008-06-15 21:43:08 +03:00
Kalle Olavi Niemitalo
fcb3ba5ba4 Revert "Some day in the future ELinks will handle copiousoutput without external"
I am reverting all copiousoutput support because of bug 917.
This reverts commit 8ebcddeff4.
2008-06-15 14:39:02 +03:00
Kalle Olavi Niemitalo
6e0d4cf4bf Revert "Copiousoutput final stage. I doubt that /dev/fd/%d is portable. It works"
I am reverting all copiousoutput support because of bug 917.
This reverts commit 6ead4e9c65.

Conflicts:

	src/session/download.c: TERM_EXEC_FG and TERM_EXEC_BG had been
	  added after the original commit.
2008-06-15 14:21:55 +03:00
Kalle Olavi Niemitalo
aae5788cc7 bug 638: More comments. Assert that calls don't nest. 2008-03-22 14:06:47 +02:00
Witold Filipczyk
4eefa983de bug 638: Save, set and restore the DISPLAY environment variable.
Thanks to this trick the appropriate handler is executed,
even in a mixed (X11, framebuffer) environment.
2008-03-22 13:08:39 +02:00
Witold Filipczyk
a6966e9472 Bug 991: Replace '%s' by % in the mailcap.c
Currently, when ELinks passes the name of a local file to an external
MIME handler program, it encodes the name as a URI.  Programs
typically do not expect this, and they then fail to open the file.
ELinks should instead quote the file name for the shell.
Unfortunately, Debian has lines like this in /etc/mailcap:

audio/mpeg; xmms '%s'; test=test "$DISPLAY" != ""

If ELinks were changed to replace the %s with e.g.
'/home/Kalle/doc/Topfield/How to upgraded the Firmware(English).pdf'
(quotes included), then the quotes would cancel out and the shell
would split the file name into multiple arguments.  That could even
provide a way for malicious persons to make ELinks run arbitrary
shell commands.

The examples in RFC 1524 all have %s without any quotes.
Debian has two bug reports about the quoting behaviour:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=90483
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=221717

This patch therefore tries to detect whether the %s has been quoted
already, and remove the quotes if so.  That way, the next patch will
be able to safely add its own quotes.  This removal of quotes applies
only to mailcap files; MIME handlers defined in elinks.conf should
already be in the format preferred by ELinks.

(The patch was attachment 438 of bug 991, by Witold Filipczyk.
 This commit message was written by Kalle Olavi Niemitalo.)
2008-03-08 21:20:57 +02:00
Jonas Fonseca
bbd7c8354a Move get_test_opt to util/test.h and use throughout test programs 2007-08-28 20:34:17 +02:00
Jonas Fonseca
0f53941fef Introduce test library in util/test.h containing the die() function
Fix the die() function to exit with EXIT_FAILURE value as pointed
out by Kalle on elinks-dev in <87tzqkxhlp.fsf@Astalo.kon.iki.fi>.
2007-08-28 20:14:08 +02:00
Kalle Olavi Niemitalo
d3d2bb26c5 New macro LIST_OF for better Doxygen support. 2007-07-26 22:45:51 +03:00
Kalle Olavi Niemitalo
68b069a657 Make MIME backend metadata const. 2007-02-04 13:34:48 +02:00
Kalle Olavi Niemitalo
22f7468013 Make arrays of option change hooks const. 2007-01-27 19:00:47 +02:00
Jonas Fonseca
7a42d2f41d Clean out some unused variables 2006-06-06 16:33:16 +02:00
Laurent MONIN
1d3656a317 Pass a pointer to a hash pointer to free_hash() to ensure hash pointer
is NULL on return.
2006-05-31 19:33:36 +02:00
Laurent MONIN
54099f5286 Do not export init_hash(),strhash() and hash_size() anymore, use a
wrapper named init_hash8() instead.
2006-05-31 19:17:01 +02:00
Witold Filipczyk
6ead4e9c65 Copiousoutput final stage. I doubt that /dev/fd/%d is portable. It works
at least under Linux. I didn't test network part of external handlers.
Files in tmpdir must be delete somehow. Maybe make a list of files
to unlink and delete them while quitting ELinks.
2006-05-04 21:19:30 +02:00
Witold Filipczyk
8ebcddeff4 Some day in the future ELinks will handle copiousoutput without external
pagers. Only a small step for now
2006-05-04 17:42:19 +02:00
Jonas Fonseca
3f659f7876 Fix the mailcap test program's dependency on gettext 2006-01-21 08:32:17 +01:00
Jonas Fonseca
3fd2828fb0 Add a simple test script of the mailcap cache
It has a few nasty hacks to reduce the dependencies on defined symbols.
2006-01-06 22:18:11 +01:00
Laurent MONIN
3f3b18e53b Indentation fix. 2006-01-02 10:50:49 +01:00
Laurent MONIN
df065ead80 Remove now useless $Id: lines. 2005-10-21 09:14:07 +02:00
Petr Baudis
0f6d4310ad Initial commit of the HEAD branch of the ELinks CVS repository, as of
Thu Sep 15 15:57:07 CEST 2005. The previous history can be added to this
by grafting.
2005-09-15 15:58:31 +02:00