1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-12 00:34:47 -04:00
Commit Graph

103 Commits

Author SHA1 Message Date
Witold Filipczyk
5bf44a6725 [locale.h] Can be included unconditionally (C90) 2021-03-19 14:35:21 +01:00
Witold Filipczyk
cba5771c0c [limits.h] limits.h can be included uncoditionally 2021-03-19 14:30:54 +01:00
sgerwk
e13c09a5f9 include unistd.h and errno.h to define safe_read() 2021-03-18 10:36:07 +01:00
Witold Filipczyk
bdc6e05410 [headers] check stdalign.h 2021-01-13 22:02:30 +01:00
Witold Filipczyk
9254649aaf [alignof] Compilation fix 2021-01-13 21:52:41 +01: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
Witold Filipczyk
1f57e72212 [mozjs24] Allow build elinks with g++
SpiderMonkey was updated to mozjs24. If you want to build elinks
with ecmascript support, you must compile using g++ with -fpermissive .
There is a lot of warnings.
There are some memleaks in ecmascript code, especially related to JSAutoCompartment.
I don't know yet, where and how to free it.

Debian does not support mozjs24, so I'm going to gradually update SpiderMonkey version.
2020-10-05 20:14:55 +02:00
Witold Filipczyk
62419b1054 [ctrl_z] Added code links-based for ctrl-z and fg. Refs #65 2020-09-09 18:08:17 +02:00
Witold Filipczyk
5f87bdbcb2 [meson] meson build scripts.
Not finished yet, but I added to motivate myself and others.
The goal is to get a few seconds faster builds.

autotools still will be available.
2020-09-05 22:06:01 +02:00
Witold Filipczyk
e572578765 [clipboard] Without HAVE_ACCESS this fragment does not make sense. 2020-07-31 14:28:34 +02:00
Witold Filipczyk
911155a862 [clipboard] Added "ui.clipboard_file" to add text to the system clipboard.
ui.clipboard_file is filename of the clipboard file. This file can be a named pipe.
See contrib/clipboard/clip.sh how to set up copying to clipboard using socat and xclip.
Just run clip.sh (it will be running in a loop) before starting elinks and
set ui.clipboard_file = "~/.elinks/clipboard.fifo".
2020-07-27 22:38:54 +02:00
Witold Filipczyk
5115a3225d [terminal] Detect gnome-terminal as x-terminal. Refs #35 2019-08-24 10:28:01 +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
Felix Janda
bfb4733f39 Don't use <sys/signal.h>
This legacy header appears to be unused. Removing its includes
avoids numerous warnings when compiling with musl libc:

/usr/include/sys/signal.h:1:2: warning: #warning redirecting incorrect #include <sys/signal.h> to <signal.h> [-Wcpp]
2017-11-23 17:51:41 -05:00
Witold Filipczyk
da15322705 Cast to (const char *) in strrchr calls 2016-04-20 21:03:27 +02:00
Witold Filipczyk
67673f5fe5 new -> new_ for C++ compatibility 2016-04-20 18:42:22 +02:00
Witold Filipczyk
2e721e051a template -> template_ for C++ compatibility 2016-04-20 18:05:00 +02:00
witekfl
9543ed96a4 Do not set FD_SETSIZE too high on Windows.
Alloc more space for threads in main/select.c instead.
2012-08-08 22:22:37 +02:00
witekfl
9313aae906 Set FD_SETSIZE 1024 2012-05-25 19:47:27 +02:00
witekfl
9c0d7dde79 Do not set title for the GNU Screen, because it beeps. 2012-01-05 19:49:22 +01:00
witekfl
eb4e5d7e0d Revert "Do not try to use gpm in X11."
This reverts commit 8183aecd90.
2011-07-06 13:41:41 +02:00
witekfl
8183aecd90 Do not try to use gpm in X11.
X11 is detected by checking DISPLAY variable.
Without this ELinks stopped on reading from /dev/gpmctl.
2011-07-06 13:19:09 +02:00
Kalle Olavi Niemitalo
e3cb8d6a77 Compile xprop_to_string only #ifdef HAVE_X11
If ELinks was configured --without-x, the build failed at
xprop_to_string:

.../src/osdep/osdep.c:500: error: expected ‘)’ before ‘*’ token

Fix by moving xprop_to_string into the #ifdef HAVE_X11 section.
Reported by Thomas Adam.
2011-04-16 13:03:27 +03:00
Kalle Olavi Niemitalo
d2cf6912b9 Save X11 window title regardless of unconvertible characters
If Xutf8TextPropertyToTextList or XmbTextPropertyToTextList returns a
positive number, that means some characters were unconvertible and
have been replaced with XDefaultString().  Use the resulting string
even in that case, as if the function had returned Success.
The previous version ignored the string and didn't even free it.
2011-04-13 00:18:32 +03:00
Kalle Olavi Niemitalo
d1245c73a8 Recode X11 window title when saving and restoring
gnome-terminal 2.30.2 expects UTF-8 in the "OSC Ps ; Pt BEL" sequence
that sets the window title.  However, XGetWMName typically returns the
title in "STRING" (Latin-1) or "COMPOUND_TEXT" (escape sequences)
encoding.  Recode the title to restore it correctly.  This helps
especially in the fi_FI.UTF-8 locale, where gnome-terminal has "Pääte"
as the default title.

Related to bugs 885 and 336.
2011-04-11 22:13:38 +03:00
Witold Filipczyk
ef33a13713 Do not #define NO_FG_EXEC for Windows.
Editing textareas with external editor works.
There is a possible buffer overflow in mkstemp.
2010-03-21 22:36:01 +01:00
Witold Filipczyk
b10144e5b4 Working implementation of mkstemp on Windows. 2010-03-21 21:44:57 +01:00
Kalle Olavi Niemitalo
34f8f6a58f Merge branch 'elinks-0.12' into master
Conflicts:
	NEWS (merged)
	configure.in (merged)
	doc/man/man1/elinks.1.in (regenerated)
	doc/man/man5/elinks.conf.5 (regenerated)
	doc/man/man5/elinkskeys.5 (regenerated)
	po/af.po (used elinks-0.12)
	po/be.po (used elinks-0.12)
	po/bg.po (used elinks-0.12)
	po/ca.po (used elinks-0.12)
	po/cs.po (used elinks-0.12)
	po/da.po (used elinks-0.12)
	po/de.po (used elinks-0.12)
	po/el.po (used elinks-0.12)
	po/es.po (used elinks-0.12)
	po/et.po (used elinks-0.12)
	po/fi.po (used elinks-0.12)
	po/fr.po (used master)
	po/gl.po (used elinks-0.12)
	po/hr.po (used elinks-0.12)
	po/hu.po (used elinks-0.12)
	po/id.po (used elinks-0.12)
	po/is.po (used elinks-0.12)
	po/it.po (used elinks-0.12)
	po/lt.po (used elinks-0.12)
	po/nb.po (used elinks-0.12)
	po/nl.po (used elinks-0.12)
	po/pl.po (used master)
	po/pt.po (used elinks-0.12)
	po/pt_BR.po (used elinks-0.12)
	po/ro.po (used elinks-0.12)
	po/ru.po (used elinks-0.12)
	po/sk.po (used elinks-0.12)
	po/sr.po (used elinks-0.12)
	po/sv.po (used elinks-0.12)
	po/tr.po (used elinks-0.12)
	po/uk.po (used elinks-0.12)
2009-03-29 18:26:20 +03:00
Kalle Olavi Niemitalo
d7d18e4e43 bug 1047: inline functions C99 conformance
C99 6.7.4p3 and 6.7.4p6 set some constraints on what can be done in
inline functions and how they can be declared.  In particular, any
function declared inline must also be defined in the same translation
unit.  To comply with that, remove inline specifiers from function
declarations in header files when the functions are not also defined
in those header files.

Sun Studio 11 on Solaris 9 is stricter than C99 and does not allow
references to static identifiers in extern inline functions.  Make the
configure script detect this and define NONSTATIC_INLINE accordingly
in config.h.  Then use that in the definitions of all non-static
inline functions.

Document the restrictions and this scheme in doc/hacking.txt.
2009-03-28 20:15:08 +02:00
Kalle Olavi Niemitalo
d2854dca8d Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	src/bookmarks/backend/default.c
	src/bookmarks/bookmarks.c
	src/session/session.c
	src/terminal/event.c
	src/viewer/text/search.c
2009-02-08 22:02:57 +02:00
Kalle Olavi Niemitalo
8d19b87cb1 Bug 885: Truncate title at 600 bytes, not 1024.
Although xterm allows 1024 bytes, GNU Screen apparently has a lower
limit.
2009-01-01 19:54:35 +00:00
Kalle Olavi Niemitalo
687f19dbde Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	src/bfu/dialog.c
	src/bfu/hotkey.c
	src/bfu/inpfield.c
	src/dialogs/options.c
	src/document/renderer.c
	src/intl/gettext/libintl.h
	src/protocol/http/codes.c
	src/session/task.c
	src/terminal/event.c
	src/terminal/terminal.h
	src/viewer/text/form.c
	src/viewer/text/link.c

And a semantic conflict in src/terminal/terminal.c.
2009-01-01 19:14:01 +00:00
Kalle Olavi Niemitalo
b6dfdf86a6 Bug 885: Proper charset support in xterm window title
When ELinks runs in an X11 terminal emulator (e.g. xterm), or in GNU
Screen, it tries to update the title of the window to match the title
of the current document.  To do this, ELinks sends an "OSC 1 ; Pt BEL"
sequence to the terminal.  Unfortunately, xterm expects the Pt string
to be in the ISO-8859-1 charset, making it impossible to display e.g.
Cyrillic characters.  In xterm patch #210 (2006-03-12) however, there
is a menu item and a resource that can make xterm take the Pt string
in UTF-8 instead, allowing characters from all around the world.
The downside is that ELinks apparently cannot ask xterm whether the
setting is on or off; so add a terminal._template_.latin1_title option
to ELinks and let the user edit that instead.

Complete list of changes:

- Add the terminal._template_.latin1_title option.  But do not add
  that to the terminal options window because it's already rather
  crowded there.

- In set_window_title(), take a new codepage argument.  Use it to
  decode the title into Unicode characters, and remove only actual
  control characters.  For example, CP437 has graphical characters in
  the 0x80...0x9F range, so don't remove those, even though ISO-8859-1
  has control characters in the same range.  Likewise, don't
  misinterpret single bytes of UTF-8 characters as control characters.

- In set_window_title(), do not truncate the title to the width of the
  window.  The font is likely to be different and proportional anyway.
  But do truncate before 1024 bytes, an xterm limit.

- In struct itrm, add a title_codepage member to remember which
  charset the master said it was going to use in the terminal window
  title.  Initialize title_codepage in handle_trm(), update it in
  dispatch_special() if the master sends the new request
  TERM_FN_TITLE_CODEPAGE, and use it in most set_window_title() calls;
  but not in the one that sets $TERM as the title, because that string
  was not received from the master and should consist of ASCII
  characters only.

- In set_terminal_title(), convert the caller-provided title to
  ISO-8859-1 or UTF-8 if appropriate, and report the codepage to the
  slave with the new TERM_FN_TITLE_CODEPAGE request.  The conversion
  can run out of memory, so return a success/error flag, rather than
  void.  In display_window_title(), check this result and don't update
  caches on error.

- Add a NEWS entry for all of this.
2009-01-01 16:17:03 +00: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
Kalle Olavi Niemitalo
1ba7d5a260 Bug 1004: Use c_toupper in a few more places.
src/config/kbdbind.c (parse_keystroke): If the user types "Ctrl-i",
it should mean "Ctrl-I" rather than "Ctrl-İ", because the Ctrl-
combinations are only well known for ASCII characters.  This does not
matter in practice though, because src/terminal/kbd.c converts 0x09
to (KBD_MOD_NONE, KBD_TAB) and not to (KBD_MOD_CTRL, 'I').

src/osdep/beos/beos.c (get_system_env): Changing the locale does not
affect the TERM environment variable, I think, so it should not affect
the interpretation either.
2008-11-01 22:32:43 +02:00
Miciah Dashiel Butler Masters
a3ad625122 Add newlines to some function signatures to comply with style standards
Make the signatures for lock_globhist_item, unlock_globhist_item,
is_globhist_item_used, and select_read comply with ELinks C style
guidelines.
2008-07-08 07:06:31 +00:00
Kalle Olavi Niemitalo
61019c3130 Debian bug 464384: fix OFF_T_FORMAT mismatches on amd64
On AMD64 apparently, off_t is long but ELinks detected SIZEOF_OFF_T == 8
and defined OFF_T_FORMAT as "lld", which expects long long and so causes
GCC to warn about a mismatching format specifier.  Because --enable-debug
adds -Werror to $CFLAGS, this warning breaks the build.  When both
SIZEOF_LONG and SIZEOF_LONG_LONG are 8, ELinks cannot know which type
it should use.

To fix this, do not attempt to find a format specifier for off_t itself.
Instead cast all printed off_t values to a new typedef off_print_T that
is large enough, and replace OFF_T_FORMAT with OFF_PRINT_FORMAT which
is suitable for off_print_T altough not necessarily for off_t.  ELinks
already had a similar scheme with time_print_T and TIME_PRINT_FORMAT.
2008-02-10 11:30:27 +02:00
Kalle Olavi Niemitalo
3b93dcc472 Debian bug 464384: fix cast warning in alignof 2008-02-09 00:24:45 +02:00
Kalle Olavi Niemitalo
a3d093bd25 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.
2008-02-04 23:22:15 +02:00
Kalle Olavi Niemitalo
cb1454918a 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.12 section)
2008-02-04 23:19:40 +02:00
Kalle Olavi Niemitalo
e530fbe8e2 Doxygenate src/util/ 2007-07-27 13:10:50 +03:00
Kalle Olavi Niemitalo
96176a8c77 Declare element types of lists. 2007-07-26 22:47:23 +03:00
Kalle Olavi Niemitalo
f0bc5c5abe Win32: Put .elinks in Application Data if %HOME% is undefined. 2007-07-18 00:27:08 +03:00
Kalle Olavi Niemitalo
6117f8a164 Name the exec_on_terminal() fg values. 2007-07-15 23:46:18 +03:00
Kalle Olavi Niemitalo
7645a836fc Cast the NULL argument of straconcat to unsigned char *.
straconcat reads the args with va_arg(ap, const unsigned char *),
and the NULL macro may have the wrong type (e.g. int).

Many places pass string literals of type char * to straconcat.  This
is in principle also a violation, but I'm ignoring it for now because
if it becomes a problem with some C implementation, then so will the
use of unsigned char * with printf "%s", which is so widespread in
ELinks that I'm not going to try fixing it now.
2007-03-11 12:59:11 +02:00
Kalle Olavi Niemitalo
1e8a61e09b OS/2: Ensure correct type of NULL pointer for variadic spawnlp. 2007-03-10 23:12:31 +02:00
Laurent MONIN
f2916d8646 unblock_itrm(),block_itrm(): drop unused parameter fd. 2007-03-05 22:54:24 +01:00
Kalle Olavi Niemitalo
763f03f146 get_clipboard_text: Disable pasting from GNU Screen's clipboard. 2007-02-11 20:56:41 +02:00
Jonas Fonseca
7589d4457a Bug 899: Fix size handling in FTP directory listings
This fixes parse_ftp_number to use off_t instead of long to store its
(intermediate) result and return type. It also introduces an OFFT_MAX type
"limit" that is used for validating the size of the parsed number.

A test-case for was added in 37c9bf3f75 to
test-ftp-parser and the patch has been confirmed to fix the test-case by
adamg and me.  This closes bug 899, which is a duplicate of debian bug
403139.
2006-12-18 18:51:57 +01:00