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

772 Commits

Author SHA1 Message Date
Kalle Olavi Niemitalo
6bfaa7ca8d Bug 1016: Avoid JSFunctionSpec. 2008-06-17 00:12:21 +03:00
Kalle Olavi Niemitalo
8d0677e76a Bug 1014: Fix incompatible pointer type in init_perl.
The second argument of PERL_SYS_INIT3 should be a char ***
but ELinks was giving it a char *(*)[1].

Also, enlarge the array to 2 elements, so that my_argv[my_argc] == NULL
like in main().  PERL_SYS_INIT3 seems hardly documented at all so I'm
not sure this is necessary, but it shouldn't hurt.
2008-06-08 20:38:50 +03:00
Paul B. Mahol
9dbfdb4738 Recognize Insert key on cons25 (FreeBSD console)
(cherry picked from commit b03ddccf08)

Conflicts:

	AUTHORS
	src/terminal/kbd.c
2008-05-31 21:30:40 +03:00
Miciah Dashiel Butler Masters
200e7ee259 save_textarea_file: don't return a dangling pointer if open fails
If fdopen failed, save_textarea_file would free the filename, but it still returned the pointer to the filename.  With this commit, save_textarea_file will return NULL if fdopen fails.
2008-05-21 20:30:33 +00:00
Kalle Olavi Niemitalo
481041ae48 Bug 939: Documented the fix.
The fix itself is in the parent commit.
(cherry picked from commit 4c390589ea,
 rewriting the NEWS entry because the bug also occurred on Debian)
2008-04-28 10:59:20 +03:00
Witold Filipczyk
26a4033cca fsp: Fixed a serious bug.
*fresult pointed to nowhere. On FreeBSD *fresult == NULL
and directories weren't displayed.
Check also if safe_write writes all data.
(cherry picked from commit 06bcc48487)
2008-04-28 10:40:14 +03:00
Witold Filipczyk
23ff9ac7a9 bittorrent: Overflow occuring when a piece was rejected. 2008-03-25 22:37:13 +01:00
Witold Filipczyk
af66d330c9 Mark option changed in "File extensions -> Add".
Previously, file extensions added or modified via the menu did not get
saved to elinks.conf when config.saving_style was 3 (the default).
This patch makes the file-extension dialog box call option_changed,
which then sets OPT_TOUCHED, so that the option appears modified in
the option manager and will be saved.

[ Reported by Witek; original patch by me; adapted to 0.11 by Witek;
  commit message by me.  --KON ]
2008-03-04 23:46:17 +02:00
Jonas Fonseca
2bfc7b3724 Minor fixes and improvements to option strings
This syncs some changes (ie. -> e.g. etc.) from elinks-0.12 or beyond.
I noticed them while updating the web pages, and apologize that I will
not spent the time to attribute it to the individual commits.

Update elinks.conf(5) while at it.
2008-03-03 03:03:11 +01:00
Witold Filipczyk
3a4c053bd5 bug 1000: Do not discard the query part of URI. 2008-03-02 13:52:19 +02:00
Kalle Olavi Niemitalo
6d2e034007 Bug 1001: fix uninitialized-pointer crash in URI rewriting 2008-03-01 15:33:41 +02:00
Jonas Fonseca
c069403b75 FTP: Test and fix handling of symbolic link name containing spaces
The bug was reported by Paul B. Mahol on elinks-users. The example is
from the FTP site he provided:

	ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-ia64/

Message-ID: <3a142e750802262008l6fd55be5v44207bc4479dd3fc@mail.gmail.com>
2008-02-27 13:23:13 +01:00
Jonas Fonseca
aa9a847c00 Fix the FTP parser test program to handle multiline responses
... so all the tests with responses stretching multiple lines are
actually tested in their entirety.
2008-02-27 13:17:46 +01:00
Jonas Fonseca
397bef882b parse_time: set tm_sec to zero before conditional second parsing
This fixes test 9 (Basic VMS responses) that uses time specs with
seconds left out (e.g. 17:44) for me.
2008-02-27 12:26:58 +01:00
Y Giridhar Appaji Nag
01b0c81227 Bug 1002: Fix build failure on Debian GNU/Linux arch powerpc
Change char id to enum bittorrent_message_id id to prevent FTBFS on
powerpc and s390
2008-02-10 12:35:17 +01:00
Jonas Fonseca
c72730628a Clean vernum.o
Reported-by: paakku on #elinks
(cherry picked from commit 442645b766)
2008-02-09 13:52:33 +02:00
Witold Filipczyk
649f7d6ca6 Avoid compilation of vernum.c in 'make install'
(cherry picked from commit 00fc1c394c)
2008-02-09 13:52:15 +02:00
Laurent MONIN
ffb5edd047 Patch: fix for bug 938
This patch prevents  handle_itrm_stdin() and clear_handlers(itrm->in.std) to be
called when -remote is set and in.std < 0.
It adds two assertions for in.std >= 0 in handle_itrm_stdin() and
unhandle_itrm_stdin().
May be a bad fix, please test and review.

[Added a NEWS entry.  --KON]
2008-02-09 13:32:53 +02:00
Kalle Olavi Niemitalo
bd67e69bcd Bug 54: Don't disable XON/XOFF flow control.
Do not clear the IXON flag in termios.c_iflag.
Bug 54 did not actually ask for this flag to be kept,
but the cable I am using doesn't seem to have the handshake
lines connected right, so XON/XOFF is a must at 38400 bps,
at least until ELinks learns to send padding based on terminfo.

Any user who has bound actions to Ctrl+S or Ctrl+Q and finds that
they no longer work should just "stty -ixon" before running ELinks.
We don't have any default bindings for those keys, fortunately.

(cherry picked from commit a3d093bd25
 but moved the NEWS entry into the 0.11.4rc0 section)
2008-02-08 00:34:11 +02:00
Kalle Olavi Niemitalo
9c39f43d1b Bug 54: Don't force 8-bit characters and no parity.
Actually, don't use the cfmakeraw function at all,
and don't look for it during configure either.

(cherry picked from commit 87f1661314
 but moved the NEWS entry into the 0.11.4rc0 section)
2008-02-08 00:32:07 +02:00
Jonas Fonseca
cbae4b250d elinks-0.11.4rc0 2008-02-04 23:36:56 +01:00
Miciah Dashiel Butler Masters
5eba524121 Missing change from last commit 2008-01-27 18:50:16 +00:00
Miciah Dashiel Butler Masters
6aa99fa078 Add KEYMAP_INVALID value for enum keymap_id and properly check for it
get_keymap_id returns -1 when it can't find the keymap.  Because the return
type of get_keymap_id is enum keymap_id and enum keymap_id did not have any
explicit values defined, it could be unsigned, which meant that when
get_keymap_id returned -1, it was really returning a huge positive number.
This meant that when callers checker whether the return value was negative,
they were essentially performing no check at all, so they might give
get_keymap_id an invalid keymap name, get back an invalid keymap_id, and
use that invalid keymap_id.

This commit adds KEYMAP_INVALID = -1 to enum keymap_id and makes all
functions that deal with the enumeration use that symbol.
2008-01-27 18:50:16 +00:00
Miciah Dashiel Butler Masters
7e0c0e14e2 Strings corrections from Malcolm Parsons
Fix the spelling and grammar in various comments, variable names, comment
descriptions, and documentation.
2008-01-27 04:17:47 +00:00
Kalle Olavi Niemitalo
a25fd18e56 Detect all overflows in BitTorrent parse_bencoding_integer.
The previous check (integer > (off_t) integer * 10) did not detect all
overflows.  Examples with 32-bit off_t:

integer = 0x1C71C71D (0x100000000/9 rounded up);
integer * 10 = 0x11C71C722, wraps to 0x1C71C722 which is > integer.

integer = 0x73333333;
integer * 10 = 0x47FFFFFFE, wraps to 0x7FFFFFFE which is > integer.

Examples with 64-bit off_t:

integer = 0x1C71C71C71C71C72 (0x10000000000000000/9 rounded up);
integer * 10 = 0x11C71C71C71C71C74, wraps to 0x1C71C71C71C71C74
which is > integer.

integer = 0x7333333333333333;
integer * 10 = 0x47FFFFFFFFFFFFFFE, wraps to 0x7FFFFFFFFFFFFFFE
which is > integer.

It is unclear to me what effect an undetected overflow would actually
have from the user's viewpoint, so I'm not adding a NEWS entry.
2008-01-26 16:42:27 +02:00
Kalle Olavi Niemitalo
f3bad399e2 Don't assume sizeof(int)==4 in bittorrent 2008-01-26 15:55:46 +02:00
Jonas Fonseca
c2a0d3b969 Use git tools instead of cogito for getting the build ID
The build ID now includes both last tagged version, commit generation
since last tagged version, as well as the leading characters of the
commit ID and a flag for dirty working tree.
2008-01-22 13:31:58 +01:00
Jonas Fonseca
5999d1ef06 Change elinks.or.cz references to elinks.cz
Except for the contrib area changes, they are already in elinks-0.12 and
master.
2008-01-22 12:36:21 +01:00
Kalle Olavi Niemitalo
3db6c84f4c Bug 997: Fix unlikely stack corruption in get_pasv_socket.
It is unlikely because the standard members of struct sockaddr_in
(sin_family, sin_port, sin_addr) already require at least 8 bytes
and I don't know of any system that has size_t larger than that.
Besides, at least glibc pads the structure to 16 bytes.
2008-01-22 00:37:36 +02:00
Kalle Olavi Niemitalo
b17fc12036 get_pasv_socket: Use AF_INET6 when appropriate.
When get_pasv6_socket was merged into get_pasv_socket on 2005-04-15,
the AF_INET6 of get_pasv6_socket was lost and the merged function
always returned AF_INET sockets.  This then made getsockname fill
only part of the struct sockaddr_in6, and ELinks sent to the server
an EPRT command that had half the bits missing from the IPv6 address.
At least ftp.funet.fi then rejected the command, helpfully saying
what the address should have been.

This commit fixes active FTP over IPv6.  Passive FTP was already fixed
in 0.11.3.GIT (887d650efe), on 2007-05-01.
2008-01-22 00:37:36 +02:00
Jonas Fonseca
f587e88839 Fix smjs scripting #ifdefs to use CONFIG_SM_SCRIPTING
(cherry picked from commit ccc6527bba)
2007-12-17 23:15:02 +02:00
Witold Filipczyk
2e926b7d4b bug 978: Python's webbrowser.open_new_tab(URL) works since now. 2007-11-22 19:09:20 +01:00
Kalle Olavi Niemitalo
de23a950f4 Bug 975: Fix int/size_t pointer type mismatch.
On machines where sizeof(size_t) > sizeof(int), this could corrupt the stack.
I think -Wno-pointer-sign added by configure hid this bug until now.
STRLEN is correct in Perl 5.6.0 and later, perhaps earlier too.
2007-11-11 10:31:19 +02:00
Kalle Olavi Niemitalo
e00b6cf7a8 Rewrite wiki to en.wikipedia.org, avoid server bug.
<http://www.wikipedia.org/w/wiki.phtml?search=sue%20lawley>
incorrectly redirects to
<http://en.wikipedia.org/w/wiki.phtml?search=sue%2520lawley>
which searches for "sue%20lawley" rather than "sue lawley".
By using en.wikipedia.org directly, we avoid the server bug.
Prompted by an elinks-users post on 2007-07-27.

I asked on #wikimedia-tech, and www.wikipedia.org does always
redirect to en.wikipedia.org; it does not guess any other
language based on headers or IP addresses or such.  Also, the
redirection exists only for compatibility, and skipping it
avoids a few roundtrips to the server.  So this change is good
even if the server is eventually fixed.
(cherry picked from commit fd902e81da)
2007-07-30 16:05:40 +03:00
Witold Filipczyk
37c04db1d6 check_html_form_hierarchy: Old code was buggy.
Old code caused the assertion failure on the shutdownday's page.
2007-07-10 15:35:23 +03:00
Kalle Olavi Niemitalo
a8fd05b401 SMJS: Fix error "forms.namedItem is not a function".
Commit 63752c854b303f5f58636a512a137bf3702e051b on 2004-12-27
seems to have broken this.

[ From commit c9b2fbbd46 in ELinks
  0.12.GIT.  --KON ]
2007-07-02 22:49:09 +03:00
Kalle Olavi Niemitalo
8d02ae75c8 Link to gitweb at repo.or.cz, rather than pasky.or.cz.
The history converted from CVS is not in repo.or.cz though, so keep
referring to pasky.or.cz for that.  (We don't seem to use
"gitweb.elinks.cz", which is a DNS alias for pasky.or.cz.)

<paakku> Do you think we should maybe point people to gitweb at
    repo.or.cz rather than pasky.or.cz?
<pasky> absolutely
<pasky> actually I thought we already are pointing people at
    repo.or.cz
<pasky> at least there was some movement to do that already, I believe
    :)

[ From commit 9f75e1f094 in ELinks
  0.12.GIT.  --KON ]
2007-07-02 22:41:42 +03:00
Kalle Olavi Niemitalo
907ef0b7d3 Reapply 644908c1, "Garbage-collect SMJS objects before flushing caches."
Reapply commit 644908c130 of 2007-05-28,
"Garbage-collect SMJS objects before flushing caches." which was reverted
in commit 6cd6a843d1 on 2007-05-30.
It is now safe to apply because bug 956 has been fixed.
2007-07-02 22:34:11 +03:00
Kalle Olavi Niemitalo
ba54124f16 Bug 960: Redefine LOADMSGCAT_USE_MMAP instead of HAVE_MMAP.
And add a prominent notice as stipulated in GNU GPL version 2 section 2a.
2007-07-02 22:24:47 +03:00
Kalle Olavi Niemitalo
566039624f Bug 957: if_assert_failed in ecmascript_put_interpreter. 2007-07-02 22:21:40 +03:00
Kalle Olavi Niemitalo
13b1d26946 Bug 957: Assert that the ECMAScript interpreter is not running.
Add ecmascript_interpreter.backend_nesting, increment it when
beginning to evaluate an expression, and decrement it when evaluation
finishes.  Then assert that it is zero in ecmascript_put_interpreter.
This detects bug 957 and similar ones before they corrupt memory.

[ Backported from commit 58e3ebf2e7 in
  ELinks 0.12.GIT.  --KON ]
2007-07-02 22:21:33 +03:00
Kalle Olavi Niemitalo
cd855a269c Bug 755: A hack to make SMJS preserve integers as private data.
The previous code cast the integer (long actually) to void * and gave
that to JS_SetPrivate.  This did not work because JS_SetPrivate
expects pointers to be aligned and replaces the least significant bit
with a tag.

[ From attachment 379 of bug 755.  This is less clean than attachment
  380 (aka commit 871a1befad in ELinks
  0.12.GIT) but avoids the need to raise the SpiderMonkey version
  requirement in the ELinks 0.11 stable branch.  --KON ]
2007-07-02 22:17:39 +03:00
Kalle Olavi Niemitalo
c16a37a9ad SMJS: comment changes
[ Backported from commit 9743729cb1 in
  ELinks 0.12.GIT.  --KON ]
2007-07-02 22:17:34 +03:00
Kalle Olavi Niemitalo
59b8eeb7fb SMJS: Use JS_GetInstancePrivate where applicable.
This is a further precaution against reading a pointer from the wrong
type of object.  All of the JS_GetPrivate calls were already protected
with JS_InstanceOf checks if assertions are enabled, and many of them
also if assertions are not enabled.

[ Backported from commit 99f648b911 in
  ELinks 0.12.GIT.  --KON ]
2007-07-02 22:17:29 +03:00
Witold Filipczyk
9bbd795787 bug 755: Fixed.
Remember the index of struct form_state in vs->form_info
instead of the pointer to it. The pointer may change,
the index is persistent.
The field ecmascript_obj of the struct form_state is unused.

[ Backported from commit ecc03ad608 in
  ELinks 0.12.GIT.  --KON ]
2007-07-02 22:17:22 +03:00
witekfl
3faeda97cb Make SpiderMonkey consistent with SEE. Do not cache ecmascript_objs
[ Backported from commit b4d9b7f5a6 in
  ELinks 0.12.GIT, to fix bug 956.  --KON ]
2007-07-02 22:13:55 +03:00
Kalle Olavi Niemitalo
38497c4b37 Compare screen_driver.name with strcmp, not memcmp.
screen_driver_change_hook was comparing only strlen(name) characters
and ignoring the '\0'.  To reproduce the bug in ELinks 0.11.3 and
ELinks 0.12.GIT:

- Run TERM=screen elinks.
- In another terminal, run TERM=scr elinks.  Quit this slave ELinks.
- Open the terminal options dialog and set 16 colors.
- Open the option manager and change the terminal.scr.colors option to
  1 and back to 0.
- Note that ELinks no longer displays colors.

That bug could be fixed just by using len+1 instead of len.  However,
there is also another bug: memcmp may compare the specified number of
bytes, even if some of the earlier ones differ; thus, it could in
principle read past the end of the malloc block and thereby crash
ELinks.  Using strcmp may be a little slower but I do not believe it
could become a bottleneck.

[ Backported from commit f6f5eeceb7 in
  ELinks 0.12.GIT.  --KON ]
2007-06-17 20:10:42 +03:00
Kalle Olavi Niemitalo
b641515fcc Ignore src/ID and src/TAGS.
The former is for GNU id-utils and the latter is for GNU Emacs.
2007-06-17 19:41:14 +03:00
Witold Filipczyk
e96665134a Fix query-part parsing in file: URIs (local CGI).
It was broken in 0.11.2.GIT (a64dd281e9).
Since then, $QUERY_STRING has been empty for <file:///foo/bar?query>.
uri.data is documented as containing both the path and the query.

[ Commit message by me.  --KON ]
2007-06-17 13:40:39 +03:00
Kalle Olavi Niemitalo
6cd6a843d1 Revert 644908c1, "Garbage-collect SMJS objects before flushing caches."
Revert commit 644908c130,
"Garbage-collect SMJS objects before flushing caches."

The extra garbage collections increase the risk of crashing because of
dangling pointers in form_state.ecmascript_obj.  I don't think I'll
have time to properly document the bug and backport the fix before
the 0.11.4 release, so I'm reverting the change instead.
2007-05-30 00:56:01 +03:00