diff --git a/AUTHORS b/AUTHORS index a1abcbe7..d9ae16a7 100644 --- a/AUTHORS +++ b/AUTHORS @@ -218,6 +218,9 @@ Hugo Haas Minor random hacking debian/watch file + + bzip2 decoding fix and rewrite + Ingo Blechschmidt German translation updates diff --git a/Makefile.config.in b/Makefile.config.in index 98afd5b5..b6802b17 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -46,7 +46,6 @@ INSTALL = $(if $(patsubst /%,,$(firstword @INSTALL@)),$(top_builddir)/)@INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ -UNINSTALL = rm -f host = @host@ @@ -83,6 +82,7 @@ PYTHON_LIBS = @PYTHON_LIBS@ RANLIB = @RANLIB@ RUBY_CFLAGS = @RUBY_CFLAGS@ RUBY_LIBS = @RUBY_LIBS@ +SEE_CFLAGS = @SEE_CFLAGS@ SPARSE = @SPARSE@ SPIDERMONKEY_CFLAGS = @SPIDERMONKEY_CFLAGS@ SPIDERMONKEY_LIBS = @SPIDERMONKEY_LIBS@ diff --git a/Makefile.lib b/Makefile.lib index 77089c01..3dd69384 100644 --- a/Makefile.lib +++ b/Makefile.lib @@ -66,8 +66,10 @@ quiet_cmd_installdata = " [$(INSTALL_COLOR)INSTALL$(END_COLOR)] $(RELPATH) quiet_cmd_installprog = " [$(INSTALL_COLOR)INSTALL$(END_COLOR)] $(RELPATH)$(2) -> $(3)" cmd_installprog = $(INSTALL_PROGRAM) $(2) $(3) -quiet_cmd_uninstall = " [$(UNINSTALL_COLOR)UNINSTALL$(END_COLOR)] $(3)/$(2)" - cmd_uninstall = $(UNINSTALL) $(3)/$(2) +# $(INSTALL_DATA) in cmd_installdata doesn't use the directory part of +# $(2) when it forms the output file name, so don't use it here either. +quiet_cmd_uninstall = " [$(UNINSTALL_COLOR)UNINSTALL$(END_COLOR)] $(3)/$(notdir $(2))" + cmd_uninstall = $(RM) $(3)/$(notdir $(2)) ############################################################################# # Special handling of conditional variables diff --git a/NEWS b/NEWS index b98c4830..e95f1c96 100644 --- a/NEWS +++ b/NEWS @@ -5,16 +5,354 @@ You can see the complete list of recent changes, bugfixes and new features in the link:http://pasky.or.cz/gitweb.cgi[gitweb interface]. See the ChangeLog file for details. -ELinks now: ------------ +ELinks 0.12.GIT now: +-------------------- -* Native FSP protocol support (replaces CGI program in contrib/fsp/) -* SEE Ecmascript backend -* Minimalistic RSS renderer +To be released as ELinks 0.12.0. + +////////////////////////////////////////////////////////////////////// +This list now contains all the important changes from ELinks 0.11.0 to +ELinks 0.12.GIT (049cc9c6b37951a739dfd6b20ca92c170188824c). The next +step will be to scan through Bugzilla and look for bug numbers that +were not mentioned in related commit messages. + +The list no doubt includes several changes that are not really +important enough. Please move them to the separate "should be removed +from NEWS" list below, or coalesce several changes into one entry (but +do list all bug numbers). It might be a good idea to sort the entries +roughly in decreasing order of importance. +////////////////////////////////////////////////////////////////////// + +* Notable new features + - (unfinished enhancement 822) UTF-8 as terminal charset: not + merely UTF-8 I/O of a unibyte codepage as in previous versions. + Double-cell (aka fullwidth) and non-BMP characters work too, but + combining characters and right-to-left text do not. The only + multibyte charset ELinks can decode is still UTF-8, so if the + server outputs e.g. Shift-JIS, you'd better recode with a proxy. + - (enhancement 844) SMB protocol using libsmbclient. This replaces + the smbclient-based code that was disabled in ELinks 0.11.2. +* Incompatibilities + - ECMAScript support is now disabled by default. It has known bugs + (548, 755, 771) with which malicious web pages can crash or hang + ELinks, and its security goals are undocumented. If you must + enable ECMAScript support, it would be prudent to restrict the + ELinks process with a sandbox of some kind. + - (bug 871) The numbering of terminal.*.colors no longer depends on + config options. This change makes elinks.conf portable between + different configurations but unfortunately not between this and + previous versions. + - Changed Python goto_url_hook(current) to goto_url_hook(new). The + hook can call the new function elinks.current_url() if desired. + The Python scripting back-end is much more featureful than in + previous releases, but it is still considered experimental. +* Miscellaneous + - (enhancement 752) Documentation updates + - (enhancement 381) Reduce memory consumption of codepages and some + other arrays. + - (enhancement) Reject invalid UTF-8 input from documents and + terminals. +* Changes in terminal support + - (enhancement) Mouse wheel support on BSD via moused -z 4 + - (enhancement) Support for mouse wheel over GPM + - (bugfix 724) Better parsing of escape sequences and control + sequences from the terminal. + - (bugfix) Decode UTF-8 only from bytes, not from codes of special + keys. + - (new feature) 24-bit truecolor mode + - (enhancement) "Resize terminal" tries to use the window size + increment. + - (new feature) Support Ctrl+Alt+letter key combinations. + - (bugfix) Subprocess forked for SIGTSTP calls _exit, not exit. + - (enhancement) Turn terminal transparency off by default. +* Changes in cookies and bookmarks + - (new feature) "Add server" button in the cookie manager. + - (enhancement) Tell the user how to move bookmarks. + - (enhancement 887) Save in cookie manager should save cookies even + if unmodified. +* Changes in the user interface + - (new feature 145) Internal clipboard support + - (enhancement) Localization updates + - (bugfix 355) Add documents displayed via "What to do" dialog to + globhist + - (new feature) Autocreate directories needed to download a file. + - (new feature) Option ui.show_menu_bar_always + - (new feature) Option ui.tabs moves the tab bar to the top. + - (new feature) New actions: kill-word-back, move-backward-word, + move-forward-word + - (enhancement) Ctrl+characters don't trigger hotkeys in menus and + dialogs. + - (bugfix 396) Never show empty filename in the what-to-do dialog + - (bugfix 930) Refresh status bar when key prefix is eaten. +* Changes in support for URI schemes, protocols, caching, and encodings + - (bugfix) Fixes cache-control issue. See elinks-users mail from 28 Oct 2005 + - (new feature) LZMA decompression + - (bugfix 517) Fixed and enabled HTTP bzip2 decompression + - (new feature) HTTP negotiate-auth using GSSAPI + - (bugfix 770) Download resuming simply restarts the download + - (bugfix 691) Fix IPv4 DNS lookup bug + - (enhancement 790) If-Modified-Since and If-None-Match + - (bugfix) gzip_read: always call gzclearerr + - (bugfix 107) Recognize "localhost" in file: URIs. + - (bugfix 756) "assertion (cached)->object.refcount >= 0 failed" + after HTTP proxy was changed + - (bugfix) Encode and decode filenames in FSP URLs. + - (enhancement) FSP progress indicator and password prompt. + - (bugfix) Support much longer locale-specific timestamps when + formatting a directory listing. LC_TIME=fi_FI.UTF-8 now works. +* Changes in parsing and rendering of HTML (without DOM) + - (bugfix) Use frame->name instead of target avoiding possible segfault. + - (bugfix 284) Render closing parentheses for HTML elements SUB, SUP + in the same line; don't let them fall to the next. + - (enhancement) Show quote characters for HTML element Q, rather + than italics. + - (enhancement) Add support for parsing space separated CSS class + attribute values + - (bugfix 387) Treat inside
...
as a newline. +* Changes in parsing and rendering of non-HTML content-types + - (new feature 121) If a mailcap entry indicates copiousoutput, + ELinks itself acts as a pager. + - (new feature 916) If a mailcap entry has no %s, provide the file + as stdin. +* Changes in the document viewer and tabs + - (new feature) Highlight links as one enters link prefixes. + - (new feature) Backspace backs out the last digit of the prefix. + - (bugfix) Tabs opened by -remote now go behind existing dialogs. + - (new feature 622) -dump-color-mode + - (bugfix) Fix accesskeys so that they work when priority is 0 + - (enhancement) Text type-ahead searching: don't follow current link + on enter + - (bugfix) Take the terminal charset in account when comparing + accesskeys. + - (enhancement) Display accesskeys as e.g. (Alt-f), not just (f). +* Changes in user scripting + - (enhancement) Guile: Read hooks.scm rather than internal-hooks.scm. + (Keep reading user-hooks.scm, too.) + - (bugfix) Lua: Don't write to the string returned by lua_tostring. + - (bugfix 945) Lua: Don't crash if a script calls e.g. error(nil). + - (enhancement) SMJS: elinks.alert no longer displays as an "error". + - (new feature) SMJS: New properties elinks.action, elinks.globhist, + elinks.vs. + - (new feature) SMJS: New function elinks.load_uri. + - (new feature) SMJS: New method elinks.execute. + - (enhancement) SMJS: Garbage-collect SMJS objects before flushing + caches. + - (bitrot) Perl: Don't assume POPpx stores the length to n_a. + - (bugfix) Perl: Fix pre_format_html hook wrt. binary files. +* Build system and compile-time errors (ignore if you don't build ELinks) + - (bugfix) Fixed some bugs about compiling outside the source + directory. + - (bugfix) Don't use cmp -b, which FreeBSD doesn't support. + - (bugfix) Don't include for MIN and MAX because it + may interfere with CONFIG_IPV6 on Linux. + - (bugfix) When the configure script cleans old object files, this + no longer causes it to loop. + - (experimental, new feature) --with-python=DIRECTORY, --with-gc=DIRECTORY + - (bugfix) Include and fix compilation on an old + PPC/Debian system + - (bitrot) Fix compilation under gcc 4.x. Backported from gentoo portage. + Also, reduce warnings on gcc 4.2 snapshots. + - (bitrot) Update SpiderMonkey configure check Debian compatibility + - (new feature 779) make uninstall + - (experimental, new feature) Native Win32 port + - (enhancement) If make -k was used and a sub-Make fails, build the + rest before propagating. + - (enhancement) Avoid compilation of vernum.c in 'make install' + - (bugfix) Don't use $(AM_CFLAGS) anymore. Use $(CPPFLAGS) instead. + - (bitrot) Fix two warnings on Mac OS X. +* (experimental) Changes in ECMAScript support + - (new feature) SEE ECMAScript backend, an alternative to SpiderMonkey. + - (new feature) Handling onsubmit + - (workaround) window.open remembers the last few URLs and doesn't + reopen them when incremental rendering reruns the onload script. + - (enhancement) Recognize document.location.href for SMJS. + - (enhancement) Better handling of form.action assignments + - (enhancement) form[x] looks up controls also by id, not only name. + - (new feature) New property input.selectedIndex. + - (new feature) Activate link only when onClick returns true. + - (enhancement) input.accessKey can be any Unicode character except + U+0000. + - (new feature) window.setTimeout, window.status +* (experimental) Changes in SGML/DOM implementation + - (new feature) Minimalistic RSS renderer + - (enhancement) Source highlighting also recognizes + application/xhtml+xml and application/docbook+xml. It doesn't yet + support arbitrary XML though. + - (enhancement) Make it possible to use more CSS properties with the + source highlighting + - (enhancement) Handle for HTML source rendering + - (enhancement) Add support for scanning comment endings such as + '--!>' correctly + - (new feature) Incremental parsing + - And more. + +////////////////////////////////////////////////////////////////////// +The following changes should be removed from NEWS before ELinks 0.12.0 +is released. They are currently listed here just to show that they +have already been considered. + +* Only partially fixed bugs: + - (bugfix 764) int/long type punning in options + - (bugfix 725) Fixes version checking for Ruby in 'configure' + - (bugfix 890) Change colors 0-15 to match xterm defaults. + The bug report also requests asking xterm to report its palette, + but that part will be delayed to 0.13 or later. +* Fixed bugs that were not in previous versions: + - (bugfix) Fix a crash when adding a server in the cookie manager. + - (bugfix) cookies: "Add Server" ignores "cookies.accept_policy". + - (bugfix) Fix data: protocol. + - (bugfix 747) Properly deselect the main menu instead of crashing + - (bugfix 778) ELinks crashes on binary files when + document.plain.display_links is set + - (bugfix 784) UTF-8 mode misconverts non-ASCII entity in Latin-1 + document + - (bugfix 782) UTF-8 buffer overwritten while in use + - (bugfix) switch_to_tab: Prevent "tab number out of range" + assertion failure. + - (bugfix) Fixed about: + - (bugfix 821) I cannot enter national characters in dialog boxes + - (bugfix 834) Gzip decompression doesn't work + - (bugfix) Fix out-of-bound access to the quote_char buffer + - (bugfix 788) compile error with --enable-perl + - (bugfix 827) Crash with term charset set to Unicode and UTF-8 I/O + disabled + - (bugfix 826) too small table for double-cell characters + - (bugfix 902) crash: "overflow detected realloc()" in realloc_line + - (bugfix 912) wrong color in one cell of an HTML input field + - (bugfix 835) Text in textarea is unaffected by horizontal + scrolling of document in UTF-8 mode + - (bugfix 823) Big textarea is too slow with CONFIG_UTF8 + - (bugfix 754) Pressing ESC do not pop up main menu anymore. + - (bugfix 794) tab-close-all-but-current crashes + - (bugfix 781) document->buf can overflow with UTF-8 enabled + - (bugfix 882) C1 controls pass through to the terminal if written + as entity references + - (bugfix 935) Yes and No buttons override the bottom border of the + dialog. +* Reverted changes: + - (new feature) document.write, reverted in + 2c087e52e74528a720621186b91880463e039d50 + - (enhancement) restore Linux console mode (UTF-8 or not), reverted + in 10d72cae7eafa6b90db1c8f303deb200555734c2 + - (enhancement) wcwidth, reverted in + d050cb67aa37390ab938b0a308c7541f19578506 + - (new feature) Let plain text change colors with ESC [ 31 m or + similar control sequences, reverted in + 2a6125e3d0407b588eb286d4d0ff5c98c23ebda9 + - (enhancement) Support for pasting from GNU screen clipboard, + reverted in 763f03f146cc1391b303c8074556f0ddea1e3c7a +* Unimportant changes: + - (enhancement) If select fails, save its errno. + - (bugfix) Use PF_* instead of AF_* as first parameter of socket(2). + (commits 8b7657deaf6037736d0abe88bae1865fec55fe93 in 0.12.GIT + and d9b56bad7d528a87376768572c2601c57d8afb02 in 0.11.0.GIT) + - (bugfix) Better error handling in save_form_data_to_file and + save_textarea_file. + (commit 6bdc34cfbcade0c25922c1ad96c753cc7d1c9949 and nearby) + - (bugfix) Do not call toupper with potentially out-of-range values. + (commit 9e30ee631ced843f26a264c351cfa1716e7e1941) + - (bugfix) If ELinks logs debug information to a file, it now opens + that in binary mode. (commit 4ced25779dca68c0e15ce1e695ce191b536bb05d) + - (bugfix) Kill the ESC timer when blocking the terminal. + (commit 539f756438fca4264ab937b2ccfba2351e916a16) + - (bugfix) Don't claim that the authentication is for HTTP. + (commit ef2f6383c6f0bed576e6f69030eacc4931b42a27) +////////////////////////////////////////////////////////////////////// + +ELinks 0.11.2.GIT now: +---------------------- + +To be released as ELinks 0.11.3. + +* critical bugs 846, 870: fix crashes in web ECMAScripts and SMJS user + scripting +* critical bug 927: fix null pointer crash if META Refresh is in a + table cell +* critical bug 941: fix assertion failure or memory corruption if FTP + server responds to PASV with status 200 +* critical bug 729 in experimental BitTorrent: fix crashes with + various bogus BitTorrent URLs +* critical bug 868: fix segfault in check_timers +* critical bugs 897, 919: fix crashes on operating systems lacking + mremap() +* critical: fix null pointer crash if XBEL bookmark has no title +* critical bug 760: fix crash when moving bookmarks out of a folder +* critical: fix crash in an empty file-extensions menu +* critical bug 715: fix null pointer crash caused by malformed proxy + setting +* critical: fix SMJS null pointer crash on exit +* critical bug 880 in experimental Python scripting: fix null pointer + crash with -no-home +* major Gentoo 121247: fix segfaults in Ruby user scripting +* major bug 908: don't write to freed memory when the user pushes a + radio button +* major bug 937: don't send the entire HTTPS request to a CONNECT + proxy +* bug 899, Debian 403139: recognize >2GB files in FTP directory + listing, if off_t is large enough +* bug 942: encode/decode file names in FTP URLs, so they can contain + spaces +* bug 741: don't recognize HTML comments inside STYLE elements +* bug 769: fix MD5 computation/formatting in HTTP digest + authentication +* fix POST to local CGI +* remove a garbage character from the end of the authentication prompt +* bugs 872, 886: editing or deleting cookies in the cookie manager + should cause a save +* secure file saving: restore umask after _all_ failure conditions +* decode the fragment identifier extracted from the URI when looking + it up +* bug 768 in experimental Python scripting: link with e.g. -lpython2.4 + rather than -lpython +* minor bugs 830, 831: changes in parsing of -remote arguments +* minor Debian 313696 and other translation updates +* enhancement 24: fix searching past unselectable elements in menus +* enhancement: recognize function keys and backspace/delete on FreeBSD +* enhancement 772: recognize Shift-Tab on XTerm +* enhancement: place cursor on listbox rather than button, to help + screen readers +* enhancements in text wrapping +* enhancement 767: recognize URL in META Refresh even without "URL=" +* enhancement 396: search for "" if the server doesn't specify a + Content-Type + +ELinks 0.11.2: +-------------- + +Released on 2006-11-19. + +* critical bug 841, CVE-2006-5925: prevent enabling the SMB protocol +* critical bug 786: fix crash when following a link in frames +* print off_t with custom OFF_T_FORMAT instead of PRId64 +* build: Minix3 compatibility + +ELinks 0.11.1: +-------------- + +Released on 2006-01-29. + +* work around null pointer crashes in HTTP digest authentication +* fix assertion failure with document.plain.display_links and + uppercase URIs +* fix Gopher crashes +* enhancement 630: native FSP protocol support (replaces CGI program + in contrib/cgi/) +* SMJS user scripting: check for hooks.js before trying to load it +* SMJS user scripting: the elinks.preformat_html hook gets a second + argument: a view_state object with .uri and .plain properties +* bug 921 in Lua scripting: fix current_document_formatted +* if given "a?b" in the command line, try to guess whether the + question mark is part of the file name or indicates a query part +* updated character entity list from unicode.org +* build: use asciidoc -unsafe for AsciiDoc 7.0.4 compatibility +* build bug 738: fix "/config.charset" error triggered by building in + the source directory ELinks 0.11.0 (Elated): ----------------------- +Released on 2006-01-01. + * SSL support via GNUTLS now requires 1.2 or higher * support for Lua 4.x was dropped, we only support Lua 5.x now * Python scripting back-end (experimental) @@ -26,30 +364,38 @@ ELinks 0.11.0 (Elated): history-move-back, and history-move-forward * BitTorrent protocol (experimental) * FSP protocol via a CGI script (see contrib/cgi/README.FSP) (experimental) -* sysmouse support on the BSD console +* enhancement 694: sysmouse support on the BSD console * new GNU make based build system (aclocal from automake is still required) * move from CVS to GIT ELinks 0.10.6: -------------- +Released on 2005-09-15. + * external editor is configurable at run-time ELinks 0.10.4: -------------- +Released on 2005-04-06. + * explicit keyboard accelerators were defined for buttons in dialogue boxes and are now highlighted ELinks 0.10.2: -------------- +Released on 2005-01-30. + * Ruby scripting back-end (experimental) * Debian package files (apt-get install devscripts && debuild -uc -us) ELinks 0.10.0 (Thelma): ----------------------- +Released on 2004-12-24. + * simple CSS * simple JavaScript/ECMAScript support by the SpiderMonkey Mozilla JS engine * plain-text mark-up (_^Hx to underline, x^Hx to embolden) @@ -81,6 +427,8 @@ ELinks 0.10.0 (Thelma): ELinks 0.9.2: ------------- +Released on 2004-09-24. + * directional links navigation * 'unset' configuration directive, which can be used, e.g., to delete default MIME type settings or external protocol handlers. @@ -88,6 +436,8 @@ ELinks 0.9.2: ELinks 0.9.1: ------------- +Released on 2004-01-23. + * support tags by displaying a link to the data * add beginning-of-buffer and end-of-buffer actions for text fields * automatic session saving/restoring support (disabled by default) @@ -100,6 +450,8 @@ ELinks 0.9.1: ELinks 0.9.0 (Skyrider): ------------------------ +Released on 2003-12-24. + * used gettext for internationalization * support for background document colors * tabs support @@ -121,6 +473,8 @@ ELinks 0.9.0 (Skyrider): ELinks 0.4.0 (Iceberg): ----------------------- +Released on 2002-12-24. + * merged HTTP_AUTH * basic proxy auth support * cookies parser rewritten @@ -153,6 +507,8 @@ ELinks 0.4.0 (Iceberg): ELinks 0.3.0: ------------- +Released on 2002-03-02. + * unhistory * external textarea editor * DNS rewrite - we handle multi RR per host correctly @@ -165,6 +521,8 @@ ELinks 0.3.0: Links 0.96-pb3: --------------- +Released on 2001-10-26. + * secured cookies file creation * support for title attribute of img tag * Catalan translation @@ -175,6 +533,8 @@ Links 0.96-pb3: Links 0.96-pb2: --------------- +Released on 2001-10-06. + * cookies expiration, saving and resaving * do NOT strip everything after ? in form action * http referrer, true http referrer diff --git a/SITES b/SITES index d729f03a..1f5ce17f 100644 --- a/SITES +++ b/SITES @@ -10,8 +10,6 @@ DEBs: RPMs: http://rpmfind.net/linux/rpm2html/search.php?query=elinks - http://ftp.nest.pld-linux.org/pool/e/elinks/ - http://ftp.pld-linux.org/pool/e/elinks/ RISC OS binaries: http://www.riscos.info/unix/indexes/browser.html @@ -43,6 +41,4 @@ DEBs: RPMs: http://rpmfind.net/linux/rpm2html/search.php?query=links - http://ftp.nest.pld-linux.org/pool/l/links/ - http://ftp.pld-linux.org/pool/l/links/ diff --git a/Unicode/cp1250.cp b/Unicode/cp1250.cp index 9c77c7bd..dee63471 100644 --- a/Unicode/cp1250.cp +++ b/Unicode/cp1250.cp @@ -147,14 +147,14 @@ Window$ 1250 0x7E 0x007E #TILDE 0x7F 0x007F #DELETE 0x80 0x20AC #EURO SIGN -0x81 0x0000 #UNDEFINED +0x81 #UNDEFINED 0x82 0x201A #SINGLE LOW-9 QUOTATION MARK -0x83 0x0000 #UNDEFINED +0x83 #UNDEFINED 0x84 0x201E #DOUBLE LOW-9 QUOTATION MARK 0x85 0x2026 #HORIZONTAL ELLIPSIS 0x86 0x2020 #DAGGER 0x87 0x2021 #DOUBLE DAGGER -0x88 0x0000 #UNDEFINED +0x88 #UNDEFINED 0x89 0x2030 #PER MILLE SIGN 0x8A 0x0160 #LATIN CAPITAL LETTER S WITH CARON 0x8B 0x2039 #SINGLE LEFT-POINTING ANGLE QUOTATION MARK @@ -162,7 +162,7 @@ Window$ 1250 0x8D 0x0164 #LATIN CAPITAL LETTER T WITH CARON 0x8E 0x017D #LATIN CAPITAL LETTER Z WITH CARON 0x8F 0x0179 #LATIN CAPITAL LETTER Z WITH ACUTE -0x90 0x0000 #UNDEFINED +0x90 #UNDEFINED 0x91 0x2018 #LEFT SINGLE QUOTATION MARK 0x92 0x2019 #RIGHT SINGLE QUOTATION MARK 0x93 0x201C #LEFT DOUBLE QUOTATION MARK @@ -170,7 +170,7 @@ Window$ 1250 0x95 0x2022 #BULLET 0x96 0x2013 #EN DASH 0x97 0x2014 #EM DASH -0x98 0x0000 #UNDEFINED +0x98 #UNDEFINED 0x99 0x2122 #TRADE MARK SIGN 0x9A 0x0161 #LATIN SMALL LETTER S WITH CARON 0x9B 0x203A #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK diff --git a/Unicode/cp1257.cp b/Unicode/cp1257.cp index 39a5e162..266f221e 100644 --- a/Unicode/cp1257.cp +++ b/Unicode/cp1257.cp @@ -23,22 +23,22 @@ Window$ 1257 0x20-0x7e idem # 0x80 0x20AC #EURO SIGN -0x81 0x0000 #UNDEFINED +0x81 #UNDEFINED 0x82 0x201A #SINGLE LOW-9 QUOTATION MARK -0x83 0x0000 #UNDEFINED +0x83 #UNDEFINED 0x84 0x201E #DOUBLE LOW-9 QUOTATION MARK 0x85 0x2026 #HORIZONTAL ELLIPSIS 0x86 0x2020 #DAGGER 0x87 0x2021 #DOUBLE DAGGER -0x88 0x0000 #UNDEFINED +0x88 #UNDEFINED 0x89 0x2030 #PER MILLE SIGN -0x8A 0x0000 #UNDEFINED +0x8A #UNDEFINED 0x8B 0x2039 #SINGLE LEFT-POINTING ANGLE QUOTATION MARK -0x8C 0x0000 #UNDEFINED +0x8C #UNDEFINED 0x8D 0x00A8 #DIAERESIS 0x8E 0x02C7 #CARON 0x8F 0x00B8 #CEDILLA -0x90 0x0000 #UNDEFINED +0x90 #UNDEFINED 0x91 0x2018 #LEFT SINGLE QUOTATION MARK 0x92 0x2019 #RIGHT SINGLE QUOTATION MARK 0x93 0x201C #LEFT DOUBLE QUOTATION MARK @@ -46,20 +46,20 @@ Window$ 1257 0x95 0x2022 #BULLET 0x96 0x2013 #EN DASH 0x97 0x2014 #EM DASH -0x98 0x0000 #UNDEFINED +0x98 #UNDEFINED 0x99 0x2122 #TRADE MARK SIGN -0x9A 0x0000 #UNDEFINED +0x9A #UNDEFINED 0x9B 0x203A #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK -0x9C 0x0000 #UNDEFINED +0x9C #UNDEFINED 0x9D 0x00AF #MACRON 0x9E 0x02DB #OGONEK -0x9F 0x0000 #UNDEFINED +0x9F #UNDEFINED 0xA0 0x00A0 #NO-BREAK SPACE -0xA1 0x0000 #UNDEFINED +0xA1 #UNDEFINED 0xA2 0x00A2 #CENT SIGN 0xA3 0x00A3 #POUND SIGN 0xA4 0x00A4 #CURRENCY SIGN -0xA5 0x0000 #UNDEFINED +0xA5 #UNDEFINED 0xA6 0x00A6 #BROKEN BAR 0xA7 0x00A7 #SECTION SIGN 0xA8 0x00D8 #LATIN CAPITAL LETTER O WITH STROKE diff --git a/Unicode/gen-7b b/Unicode/gen-7b index 41a746d5..de3876ce 100755 --- a/Unicode/gen-7b +++ b/Unicode/gen-7b @@ -8,7 +8,7 @@ N=`cat tmp | wc -l` echo '/* Automatically generated by gen-7b */' echo '/* DO NOT EDIT THIS FILE! EDIT Unicode/7bitrepl.lnx INSTEAD! */' echo -echo 'struct { unicode_val_T x; unsigned char *s; } unicode_7b ['`expr $N + 1`'] = {' +echo 'static const struct { unicode_val_T x; unsigned char *s; } unicode_7b ['`expr $N + 1`'] = {' sort tmp | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | sed 's/^/ {/' | sed 's/:/, "/' | sed 's/$/"},/' echo ' {-1, NULL}' echo '};' diff --git a/Unicode/gen-cp b/Unicode/gen-cp index b1e289b2..83f8090d 100755 --- a/Unicode/gen-cp +++ b/Unicode/gen-cp @@ -23,17 +23,29 @@ for i in $codepages; do echo "/*** $i ***/" echo - sed '1,2d + sed ' # Delete the name and aliases lines. + 1,2d + # Delete comment-only and blank lines. /^[ ]*\(#.*\)\{,1\}$/d + # Copy to the hold space. h + # Delete everything except the comment. s/^[^#]*// + # If there is a comment, change it to use /* */ delimiters. s!#[ ]*\(.*\)!/* \1 */! + # Exchange spaces; now hold space = comment and pattern space = all. x + # Delete the comment. s/#.*// + # Canonicalize case so the strings can be used as lookup keys. y/Xabcdef/xABCDEF/ + # Delete mappings of bytes 0x00...0x7F. ELinks assumes those match ASCII. /^0x[01234567]/d - /[^0x0123456789ABCDEF ]/d + # Delete lines that do not map the byte to exactly one character. + /^[ ]*0x[0123456789ABCDEF]\{2\}[ ]\{1,\}0x[0123456789ABCDEF]\{1,\}[ ]*$/!d + # Append a newline and the comment from the hold space. G + # Delete the newline added by the previous command. s/\n//' "$i.cp" | { for left in 8 9 A B C D E F; do for right in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do diff --git a/Unicode/gen-ent b/Unicode/gen-ent index 1fdf1ffe..e1f2d318 100755 --- a/Unicode/gen-ent +++ b/Unicode/gen-ent @@ -16,7 +16,7 @@ N=`cat tmp | wc -l` cat > ../src/intl/entity.inc <dx && !event->dy && (event->buttons==oldB)) ++ if (!event->dx && !event->dy && !event->wdx && !event->wdy && (event->buttons==oldB)) + do { /* so to break */ + static long awaketime; + /* diff --git a/contrib/python/hooks.py b/contrib/python/hooks.py index 0d4151ac..28cbf32b 100644 --- a/contrib/python/hooks.py +++ b/contrib/python/hooks.py @@ -46,17 +46,16 @@ dumbprefixes = { "sd" : "http://www.slashdot.org/" } -def goto_url_hook(url, current_url): +def goto_url_hook(url): """Rewrite a URL that was entered in a "Go to URL" dialog box. - This function should return a URL for ELinks to follow, or None if + This function should return a string containing a URL for ELinks to + follow, or an empty string if no URL should be followed, or None if ELinks should follow the original URL. Arguments: url -- The URL provided by the user. - current_url -- The URL of the document being viewed, or None if no - document is being viewed. """ if url in dumbprefixes: @@ -65,7 +64,8 @@ def goto_url_hook(url, current_url): def follow_url_hook(url): """Rewrite a URL for a link that's about to be followed. - This function should return a URL for ELinks to follow, or None if + This function should return a string containing a URL for ELinks to + follow, or an empty string if no URL should be followed, or None if ELinks should follow the original URL. Arguments: @@ -136,13 +136,12 @@ class goto_url_in_new_tab: """Prompter that opens a given URL in a new tab.""" def __init__(self): """Prompt for a URL.""" - self.current_location = elinks.current_url() elinks.input_box("Enter URL", self._callback, title="Go to URL") def _callback(self, url): """Open the given URL in a new tab.""" if 'goto_url_hook' in globals(): # Mimic the standard "Go to URL" dialog by calling goto_url_hook(). - url = goto_url_hook(url, self.current_location) or url + url = goto_url_hook(url) or url if url: elinks.open(url, new_tab=True) # The elinks.bind_key() function can be used to create a keystroke binding diff --git a/doc/Makefile b/doc/Makefile index 2053e9a4..eb6980fd 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -92,9 +92,9 @@ install-doc: all-docs update-man install update-man: man @$(if $(MAN_DOCS), \ - $(call ncmd,installdata,elinks.1,man/man1/elinks.1.in); \ - $(call ncmd,installdata,elinkskeys.5,man/man5/); \ - $(call ncmd,installdata,elinks.conf.5,man/man5/)) + $(call ncmd,installdata,elinks.1,$(srcdir)man/man1/elinks.1.in); \ + $(call ncmd,installdata,elinkskeys.5,$(srcdir)man/man5/); \ + $(call ncmd,installdata,elinks.conf.5,$(srcdir)man/man5/)) clean-local: @$(RM) -r api $(TXT_DOCS_NOINSTALL) $(MAN_DOCS) $(HTML_DOCS) $(HTML_DOCS_NOINSTALL) $(PDF_DOCS) *.tmp *.xml @@ -165,11 +165,24 @@ asciidoc_dep = sed -n 's/[{]builddir}//g;s@include::\(.*\)\[.*@$@: $< \1@p' < $< -include .deps/*.asciidoc # Do a little post-processing of man pages. Inserting title headers and date. +# - Change SYNOPSIS to OVERVIEW in elinkskeys.5 (but not in elinks.1). +# SYNOPSIS isn't supposed to contain running text. But AsciiDoc +# 7.1.2 complains "ERROR: elinkskeys.5.txt: line 10: second section +# must be named SYNOPSIS" so we can't change this in elinkskeys.5.txt. +# - Write backslash as "\e" not "\\", but be careful not to replace +# double-backslashes that actually mean something else. This is +# apparently a bug in db2man, which xmlto runs. +# Run all the hacks together in one sed command so that we get the right +# exit code if there is an error somewhere in the middle. MAN_DATE = $(shell date -I) man_desc = `sed -n 's/:Description:\s*\(.*\)/\1/p' < $(srcdir)$(subst .xml,.txt,$( $@.tmp && mv $@.tmp $@ - +man_hack = sed -e "s/^\(\.TH \"ELINKS[^\"]*\" [0-9] \).*/\1\"$(1)\" \"$(MAN_DATE)\" \"$(1)\"/" \ + -e 's/\\\\\\\\ /\\e\\e /' \ + -e 's/\(\\fI\)\\\\\(\\fR\)/\1\\e\2/' \ + -e "s/@squote@/\\\\'/g" \ + $(if $(findstring elinkskeys.5,$( $@.tmp \ + && mv $@.tmp $@ ############################################################################# # Build recipies diff --git a/doc/bittorrent.txt b/doc/bittorrent.txt index f1ebb522..5bf637cd 100644 --- a/doc/bittorrent.txt +++ b/doc/bittorrent.txt @@ -5,7 +5,7 @@ This chapter provides a small manual for using the implemented BitTorrent client. The BitTorrent client is provided as an optional add-on for ELinks, and needs to be enabled at compile time. To build ELinks with BitTorrent support be sure to either pass -`--enable-bittorrent` to `./configure` or change the value of +`\--enable-bittorrent` to `./configure` or change the value of `CONFIG_BITTORRENT` to `yes` in `features.conf`. Using the BitTorrent Client diff --git a/doc/elinkskeys.5.txt b/doc/elinkskeys.5.txt index a59c1583..30715ee1 100644 --- a/doc/elinkskeys.5.txt +++ b/doc/elinkskeys.5.txt @@ -32,9 +32,9 @@ where: :: - is a case sensitive key, which you can prefix with 'Ctrl-' or 'Alt-'. - 'Ctrl-' must be followed by an uppercase key. See below for a list of - valid keys. + is a case sensitive key, which you can prefix with 'Ctrl-', 'Alt-', + or both. 'Ctrl-' must be followed by an uppercase key. See below for + a list of valid keys. :: diff --git a/doc/exmode.txt b/doc/exmode.txt index fb26fa85..d35a62a9 100644 --- a/doc/exmode.txt +++ b/doc/exmode.txt @@ -6,7 +6,7 @@ Are you a vim-controls nerd who wants to see them everywhere? Welcome. Actually ELinks doesn't shine in this area yet very much. Heck, the famous hjkl foursome is still occupied by some feeble managers in the default keymap (we have that in our monumental TODO lists). Still, if you know what to touch -during the compilation (`--enable-exmode`), you can get at least some familiar +during the compilation (`\--enable-exmode`), you can get at least some familiar reply to the mighty ``:'' (colon) grip. diff --git a/doc/faq.txt b/doc/faq.txt index 4123bea4..f7ff4b24 100644 --- a/doc/faq.txt +++ b/doc/faq.txt @@ -34,7 +34,7 @@ The reason why normal cut and paste does not work is that ELinks requests all mouse event info even if it is compiled without GPM. Therefore it is necessary to hold down the Shift key when cutting or pasting text. If you do not need to use the mouse for navigation you can disable mouse support by passing -`--disable-mouse` to configure. +`\--disable-mouse` to configure. [[move]] @@ -110,7 +110,7 @@ First, you must enable it in the `feature.conf` file before compiling. Second, you must run ELinks on a terminal that supports 256 colours: - link:http://dickey.his.com/xterm/xterm.html[Thomas Dickey's XTerm], - revision 111. XTerm must be compiled with `--enable-256-color`. + revision 111. XTerm must be compiled with `\--enable-256-color`. - Recent versions of link:http://www.chiark.greenend.org.uk/~sgtatham/putty/[PuTTY]. diff --git a/doc/hacking.txt b/doc/hacking.txt index 140adf50..2a4979bc 100644 --- a/doc/hacking.txt +++ b/doc/hacking.txt @@ -1,5 +1,5 @@ Hacking ELinks --------------- +============== Welcome, mere mortal, to the realm of evil unindented code, heaps of one or two-letter variables, seas of gotos accompanied with 30-letters labels in Czech @@ -12,7 +12,7 @@ Motto: I didn't expect someone to look at the source, so it's unreadable. Language files -~~~~~~~~~~~~~~ +-------------- Each UI output should use language files in order to be able to translate the messages to a desired language. Those language files reside in the po/ subdir. If @@ -22,7 +22,7 @@ your own system, you have to have the gettext tools installed. ELinks philosophy -~~~~~~~~~~~~~~~~~ +----------------- ELinks is based on the philosophy of asynchronism. That means, you pass a callback to each function, and when the requested task finishes sometime in the @@ -55,7 +55,7 @@ directory. HTML parser -~~~~~~~~~~~ +----------- The following was found in the mailing list archive - Mikulas wrote it: @@ -86,7 +86,7 @@ functions only calculate size. Documents management -~~~~~~~~~~~~~~~~~~~~ +-------------------- Just a few words regarding the document structures. To understand the code, it is important to note the difference between rendered documents and document @@ -114,7 +114,7 @@ those view_states up, you get a session history. Lua support -~~~~~~~~~~~ +----------- Peter Wang wrote this on the mailing list: @@ -196,7 +196,7 @@ pressed, we branch off to some Lua code. Coding style -~~~~~~~~~~~~ +------------ Mikulas once said that 'it was hard to code, so it should be hard to read' - and he drove by this when he was writing links. However, we do NOT drive by @@ -247,7 +247,7 @@ at the start of block only. Comments -~~~~~~~~ +-------- Use blank lines frequently to separate chunks of code. And use magic `/\*` and `*/` to give others an idea about what it does and about possible pitfalls. @@ -313,14 +313,14 @@ place it on the preceding line. More about style -~~~~~~~~~~~~~~~~ +---------------- Note: We use short variables names and stupid examples here, do not take that as a guideline for _REAL_ coding. Always use descriptive variables names and do not write stupid code ;). General style is: -^^^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------------ [blank line] @@ -346,7 +346,7 @@ func(int a, int b) ------------------------------------------------------------------------------ You should observe the following rules: -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Always have a blank line before a function declaration or comment. @@ -432,8 +432,8 @@ foreach(a, b) if (a == c) ... else ... If you have a chain of if () { .. } else if () { .. } else { .. } with longer statements, you can insert a blank line before each else line. -Label names should start on the first column and with have a blank line before -it. +Label names should start on the first column and a blank line should be +inserted before it. .Use: ------------------------------------------------------------------------------- @@ -497,6 +497,9 @@ Use assert() and assertm() where applicable. It will prevent hidden bugs. Names of enum constants should be in upper case. +Please call the charset "utf8" or "UTF8" in identifiers, "UTF-8" +elsewhere, and "utf_8" only for compatibility. + If you see code in ELinks that doesn't follow these rules, fix it or tell us about it. @@ -514,10 +517,10 @@ exception and be prepared to defend your exception at anytime ;). Coding practices -~~~~~~~~~~~~~~~~ +---------------- Use bitfields to store boolean values -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If speed is not critical and especially if you are messing with some struct where size might matter, feel encouraged to use bitfields to store boolean (or @@ -527,7 +530,7 @@ to reach the top bit in these cases, and with int foo:1, foo would be either 0 or -1, which is probably not what you want. Wrap hard initializations of structures with macros -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This should be done if the structure's initializers are going to be spread widely (so that we can grep for them easily), there are massive typecasts @@ -555,7 +558,7 @@ struct example t = NULL_EXAMPLE; ------------------------------------------------------------------------------- Please try to keep order of fields -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Please try to keep order of fields from max. to min. of size of each type of fields, especially in structures: @@ -580,7 +583,7 @@ logical composition always takes precedence over this optimization, modulo some very rare critical structures. Please do not use sizeof(struct item_struct_name) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Instead use sizeof(*item) when possible. @@ -613,7 +616,7 @@ The preferred form eases future changes in types, and maintain size vs type coherence. Please postfix defined types with _T -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ------------------------------------------------------------------------------- typedef int (some_func_T)(void *); @@ -621,7 +624,7 @@ typedef long long our_long_T; ------------------------------------------------------------------------------- Please use mode_t and S_I???? macros instead of numeric modes -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .Use: ------------------------------------------------------------------------------- @@ -638,7 +641,7 @@ S_IWUSR, S_IXUSR instead. Patches -~~~~~~~ +------- Please send unified patches only. @@ -675,7 +678,7 @@ sufficiently self-contained. Advantages of `--enable-debug` configure option -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +----------------------------------------------- Since ELinks 0.4pre11, a memory debugger can be enabled using the `--enable-debug` configure script option. It may help to find memleaks and more diff --git a/doc/installation.txt b/doc/installation.txt index b8e076e7..efabb144 100644 --- a/doc/installation.txt +++ b/doc/installation.txt @@ -34,7 +34,12 @@ have the following libraries and programs installed: Dependency Description ----------------------------------------------------------------------------- Lua or Guile Makes it possible to write scripting plugins. \ +ifdef::installation-webpage[] + See link:manual.html#lua-scripting[the Elinks - Lua interface] \ +endif::installation-webpage[] +ifndef::installation-webpage[] See <> \ +endif::installation-webpage[] for more info. GNU zip For handling compressed documents both locally and \ sent from server. @@ -50,7 +55,12 @@ xterm with 256 colors Program atleast patch level 179 or rxvt program \ libidn For internationalized domain names. SpiderMonkey Mozilla's JavaScript engine for getting \ JavaScript/ECMAScript support in ELinks. \ +ifdef::installation-webpage[] + See also link:manual.html#ecmascript[notes on ECMAScript support]. +endif::installation-webpage[] +ifndef::installation-webpage[] See also <>. +endif::installation-webpage[] ----------------------------------------------------------------------------- When compiling, you also need the header files for the libraries. Most OS diff --git a/doc/lua-scripting.txt b/doc/lua-scripting.txt index ae78ac72..fc71b12b 100644 --- a/doc/lua-scripting.txt +++ b/doc/lua-scripting.txt @@ -17,7 +17,7 @@ own bookmarks system with Lua. See also contrib/lua/ for some examples of the possibilities of ELinks Lua support. Please do not confuse Lua scripting with JavaScript, EcmaScript, VBScript and -similiar. Those are embedded in page, allowing per-document scripting related +similar. Those are embedded in page, allowing per-document scripting related to its presentation and providing some degree of interactivity etc. On the contrary, the current Lua support permits scripts to be embedded to the browser directly, changing the behaviour of the browser, not the document. @@ -34,12 +34,12 @@ The Lua scripting support comes with the stock ELinks distribution, no additional patches and tweaks should be needed. The web site of the original Links-Lua is at -link:http://links.sourceforge.net/links-lua/[]. Some older patches against +http://links.sourceforge.net/links-lua/[]. Some older patches against regular Links are available at -link:http://www.sourceforge.net/projects/links/[], but they are not being +http://www.sourceforge.net/projects/links/[], but they are not being maintained. -Lua can be found at link:http://www.lua.org/[]. +Lua can be found at http://www.lua.org/[]. What it runs on ^^^^^^^^^^^^^^^ @@ -72,6 +72,10 @@ systems should try to enable `popen` support, but this is not necessary On systems without shared object support, simply run `make; make install` instead. +Since ELinks 0.11.0, only version 5.0 of Lua is supported. +Future versions of ELinks will probably support Lua 5.1 too; +see http://bugzilla.elinks.cz/show_bug.cgi?id=742[bug 742]. + Installing ELinks ^^^^^^^^^^^^^^^^^ @@ -85,8 +89,9 @@ Running ELinks with Lua ^^^^^^^^^^^^^^^^^^^^^^^ Simply start ELinks as you normally would. To check you have Lua support -compiled in, open up the "Help | About" dialog box. It should list "Lua" -under "Features". If not, make sure you do not have other copies of ELinks +compiled in, open up the "Help | About" dialog box. It should list +"Scripting (Lua)" under "Features". +If not, make sure you do not have other copies of ELinks running, or start ELinks again with the "-no-connect" option on the command-line. @@ -114,7 +119,7 @@ they're more convenient. Note that this document assumes you have some knowledge of programming in Lua. For that, you should refer to the Lua reference manual -(link:http://www.lua.org/docs.html[]). In fact, the language is relatively +(http://www.lua.org/docs.html[]). In fact, the language is relatively trivial, though. You could already do wonders with simply refactoring the example scripts. @@ -152,6 +157,12 @@ pre_format_html_hook (url, html):: should return the modified HTML text, or `nil` if there were no modifications. +proxy_for_hook (url):: + This hook is called when ELinks is about to load a resource + from a URL. It should return "PROXY:PORT" (e.g. "localhost:8080") + to use the specified proxy, "" to contact the origin server + directly, or `nil` to use the default proxy of the protocol. + lua_console_hook (string):: This hook is passed the string that the user entered into the "Lua Console" dialog box. It should return two values: the type of action @@ -162,7 +173,7 @@ lua_console_hook (string):: `someprogram`. - `return "eval", "somefunction(1+2)"` will attempt to call the Lua function `somefunction` with an argument, 3. - - `return "goto-url", "http://www.bogus.com"` will ask Links to visit + - `return "goto_url", "http://www.bogus.com"` will ask Links to visit the URL "http://www.bogus.com". - `return nil` will do nothing. @@ -177,16 +188,11 @@ Functions As well as providing hooks, ELinks provides some functions in addition to the standard Lua functions. -enable_systems_functions ():: -Enable some potentially dangerous functions, as well as some other -functions which were unfortunate enough to be lumped in the same group. -+ -The functions are: `openfile`, `closefile`, `readfrom`, `writeto`, `appendto`, -`pipe_read`, `remove`, `rename`, `flush`, `seek`, `tmpname`, `read`, `write` -`execute`, `exit`, `clock`, `date`, `getenv`, `setlocale`. -+ -Note: `setlocale` is a standard Lua function and will not affect -the current ELinks locale. +Note: The standard Lua function `os.setlocale` affects ELinks' idea of +the system locale, which ELinks uses for the "System" charset, for the +"System" language, and for formatting dates. This may however have to +be changed in a future version of ELinks, in order to properly support +terminal-specific system locales. current_url ():: Returns the URL of the current page being shown (in the ELinks session @@ -216,17 +222,68 @@ pipe_read (command):: function `read` seems to crash ELinks when used in pipe-reading mode. execute (string):: - Executes shell commands `string` and returns the exit code. Beware + Executes shell commands `string` without waiting for it to exit. Beware that you must not read or write to stdin and stdout. And unlike the standard Lua function of the same name, the return value is meaningless. +tmpname ():: + Returns a unique name for a temporary file, or `nil` if no + such name is available. The returned string includes the + directory name. This function does not create the file and + does not guarantee exclusive access to it: the caller must + handle the possibility that another process creates the file + and begins using it while this function is returning. + bind_key (keymap, keystroke, function):: Currently, `keymap` must be the string `"main"`. Keystroke is a keystroke as you would write it in the ELinks config file `~/.elinks/elinks.conf`. The function `function` should take no arguments, and should return the same values as `lua_console_hook`. +edit_bookmark_dialog (cat, name, url, function):: + Displays a dialog for editing a bookmark, and returns without + waiting for the user to close the dialog. The return value is + `1` if successful, `nil` if arguments are invalid, or nothing + at all if out of memory. The first three arguments + must be strings, and the user can then edit them in input + fields. There are also 'OK' and 'Cancel' buttons in the + dialog. If the user presses 'OK', ELinks calls `function` + with the three edited strings as arguments, and it should + return similar values as in `lua_console_hook`. + +xdialog (string [, more strings...], function):: + Displays a generic dialog for editing multiple strings, and + returns without waiting for the user to close the dialog. + The return value is `1` if successful, `nil` if arguments are + invalid, or nothing at all if out of memory. All arguments + except the last one must be strings, and ELinks places them + in input fields in the dialog. There can be at most 5 such + strings. There are also 'OK' and 'Cancel' buttons in the + dialog. If the user presses 'OK', ELinks calls `function` + with the edited strings as arguments, and it should return + similar values as in `lua_console_hook`. + +set_option (option, value):: + Sets an ELinks option. The first argument `option` must be + the name of the option as a string. ELinks then tries to + convert the second argument `value` to match the type of the + option. If successful, `set_option` returns `value`, else + `nil`. + +get_option (option):: + Returns the value of an ELinks option. The argument `option` + must be the name of the option as a string. If the option + does not exist, `get_option` returns `nil`. + + +Variables +^^^^^^^^^ + +elinks_home:: + The name of the ELinks home directory, as a string. Typically + this is the .elinks subdirectory of the user's home directory. + User protocol ^^^^^^^^^^^^^ diff --git a/doc/mailcap.txt b/doc/mailcap.txt index 13583adc..5980f402 100644 --- a/doc/mailcap.txt +++ b/doc/mailcap.txt @@ -21,7 +21,7 @@ on most UNIX systems--usually in /etc/mailcap--so this makes it possible for ELinks to know how to handle a great variety of file formats with little configuration. To be able to use mailcap, it has to be compiled into ELinks. This is the default. If you don't need mailcap support, just configure ELinks -with the flag: --disable-mailcap. +with the flag: \--disable-mailcap. Parameters to Mailcap Entries @@ -92,7 +92,7 @@ or present on your system. Mailcap Configuration ~~~~~~~~~~~~~~~~~~~~~ -Apart from the mime.mailcap.path option, you can configure if mailca support +Apart from the mime.mailcap.path option, you can configure if mailcap support should be disabled. The default being that it is enabled. To disable it just put: @@ -100,8 +100,8 @@ put: in elinks.conf. -It is also possible to control wether ELinks should ask you before opening a -file. The option is a boolian and can be set like this: +It is also possible to control whether ELinks should ask you before opening a +file. The option is a boolean and can be set like this: set mime.mailcap.ask = 1 diff --git a/doc/man/man1/elinks.1.in b/doc/man/man1/elinks.1.in index f92b9e6d..158326c4 100644 --- a/doc/man/man1/elinks.1.in +++ b/doc/man/man1/elinks.1.in @@ -17,7 +17,7 @@ .el .ne 3 .IP "\\$1" \\$2 .. -.TH "ELINKS" 1 "The Elinks text-browser" "2006-06-12" "The Elinks text-browser" +.TH "ELINKS" 1 "The Elinks text-browser" "2007-01-06" "The Elinks text-browser" .SH NAME elinks \- lynx-like alternative character mode WWW browser .SH "SYNOPSIS" diff --git a/doc/man/man5/elinks.conf.5 b/doc/man/man5/elinks.conf.5 index 813d901a..f03f40f4 100644 --- a/doc/man/man5/elinks.conf.5 +++ b/doc/man/man5/elinks.conf.5 @@ -17,7 +17,7 @@ .el .ne 3 .IP "\\$1" \\$2 .. -.TH "ELINKS.CONF" 5 "ELinks configuration file" "2006-06-12" "ELinks configuration file" +.TH "ELINKS.CONF" 5 "ELinks configuration file" "2007-01-06" "ELinks configuration file" .SH NAME elinks.conf \- ELinks configuration file .SH "SYNOPSIS" @@ -77,7 +77,7 @@ File format for bookmarks (affects both reading and saving): 0: is the default native \fIELinks\fR format .TP \(bu -1: is XBEL universal XML bookmarks format (NO NATIONAL CHARS SUPPORT!) +1: is XBEL universal XML bookmarks format (\fIELinks\fR bug 153: NO NATIONAL CHARS SUPPORT!) .LP .RE .IP @@ -194,11 +194,11 @@ Number of tries to establish a connection\&. Zero means try forever\&. .TP connection\&.try_ipv4 [0|1] (default: 1) -Whether to try to connect to a host over IPv4\&. Note that if connection\&.try_ipv6 is enabled too, it takes precedence\&. And better do not touch this at all unless you are sure what are you doing\&. Note that you can also force a given protocol to be used on a per\-connection basis by using an URL in the style of i\&.e\&. http4://elinks\&.or\&.cz/\&. +Whether to try to connect to a host over IPv4\&. Note that if connection\&.try_ipv6 is enabled too, it takes precedence\&. And better do not touch this at all unless you are sure what are you doing\&. Note that you can also force a given protocol to be used on a per\-connection basis by using an URL in the style of e\&.g\&. http4://elinks\&.cz/\&. .TP connection\&.try_ipv6 [0|1] (default: 1) -Whether to try to connect to a host over IPv6\&. Note that you can also force a given protocol to be used on a per\-connection basis by using an URL in the style of i\&.e\&. http6://elinks\&.or\&.cz/\&. +Whether to try to connect to a host over IPv6\&. Note that you can also force a given protocol to be used on a per\-connection basis by using an URL in the style of e\&.g\&. http6://elinks\&.cz/\&. .TP connection\&.unrestartable_receive_timeout (default: 600) @@ -634,6 +634,10 @@ Cache even redirects sent by server (usually thru HTTP by a 302 HTTP code and a document\&.cache\&.ignore_cache_control [0|1] (default: 1) Ignore Cache\-Control and Pragma server headers\&. When set, the document is cached even with 'Cache\-Control: no\-cache'\&. +.TP +document\&.cache\&.revalidation_interval (default: \-1) +Period that a cache entry is considered to be up\-to\-date\&. When a document is loaded and this interval has elapsed since the document was initially loaded or most recently revalidated with the server, the server will be checked in case there is a more up\-to\-date version of the document\&. + .TP document\&.codepage Charset options\&. @@ -778,7 +782,7 @@ Codepage used in dump output\&. 'System' stands for a codepage determined by a s .TP document\&.dump\&.color_mode (default: \-1) -Color mode for dumps: +Color mode for dumps\&. Some modes may have been disabled at compile time\&. The Setup \-> Terminal options dialog lists the modes supported by this executable\&. If you select an unsupported mode, \fIELinks\fR uses 16 colors\&. The color modes are: .RS .TP 3 @@ -792,7 +796,13 @@ Color mode for dumps: 1: is 16 color mode .TP \(bu -2: is 256 color mode +2: is 88 color mode +.TP +\(bu +3: is 256 color mode +.TP +\(bu +4: is true color mode .LP .RE .IP @@ -921,7 +931,7 @@ Compress successive empty lines to only one in displayed text\&. .TP document\&.uri_passing -Rules for passing URIs to external commands\&. When one rule is defined the link and tab menu will have a menu item that makes it possible to pass the the link, frame or tab URI to an external command\&. If several rules are defined the link and tab menu will have a submenu of items for each rule\&. Note, this is mostly useful for launching graphical viewers, since there is not support for releasing the terminal while the command runs\&. The action and submenus are also available by binding keys to the frame\-external\-command, the link\-external\-command, and the tab\-external\-command actions\&. +Rules for passing URIs to external commands\&. When one rule is defined the link and tab menu will have a menu item that makes it possible to pass the the link, frame or tab URI to an external command\&. If several rules are defined the link and tab menu will have a submenu of items for each rule\&. Note, this is mostly useful for launching graphical viewers, since there is no support for releasing the terminal while the command runs\&. The action and submenus are also available by binding keys to the frame\-external\-command, the link\-external\-command, and the tab\-external\-command actions\&. .TP document\&.uri_passing\&._template_ (default: "") @@ -932,7 +942,7 @@ ecmascript ECMAScript options\&. .TP -ecmascript\&.enable [0|1] (default: 1) +ecmascript\&.enable [0|1] (default: 0) Whether to run those scripts inside of documents\&. .TP @@ -1378,14 +1388,6 @@ Enable dumb prefixes \- simple URI abbreviations which can be written to the Got protocol\&.rewrite\&.enable\-smart [0|1] (default: 1) Enable smart prefixes \- URI templates triggered by writing given abbreviation to the Goto URL dialog followed by a list of arguments from which the actual URI is composed \- i\&.e\&. 'gg:search keywords' or \fIgn search keywords for news\fR\&. -.TP -protocol\&.smb -SAMBA specific options\&. - -.TP -protocol\&.smb\&.credentials (default: "") -Credentials file passed to smbclient via \-A option\&. - .TP protocol\&.user User protocols\&. Options in this tree specify external handlers for the appropriate protocols\&. Ie\&. protocol\&.user\&.mailto\&.unix\&. @@ -1440,7 +1442,7 @@ Switch fonts when drawing lines, enabling both local characters and lines workin .TP terminal\&._template_\&.utf_8_io [0|1] (default: 0) -Enable I/O in UTF8 for Unicode terminals\&. Note that currently, only the subset of UTF8 according to terminal codepage is used\&. +Enable I/O in UTF\-8 for Unicode terminals\&. Note that currently, only the subset of UTF\-8 according to terminal codepage is used\&. \fIELinks\fR ignores this option if the terminal codepage is UTF\-8\&. .TP terminal\&._template_\&.restrict_852 [0|1] (default: 0) @@ -1452,7 +1454,7 @@ Move cursor to bottom right corner when done drawing\&. This is particularly use .TP terminal\&._template_\&.colors (default: 0) -The color mode controls what colors are used and how they are output to the terminal\&. The color modes are: +The color mode controls what colors are used and how they are output to the terminal\&. Some modes may have been disabled at compile time\&. The Setup \-> Terminal options dialog lists the modes supported by this executable\&. If you select an unsupported mode, \fIELinks\fR uses 16 colors\&. The color modes are: .RS .TP 3 @@ -1463,14 +1465,20 @@ The color mode controls what colors are used and how they are output to the term 1: is 16 color mode, uses the common ANSI colors .TP \(bu -2: is 256 color mode, uses XTerm RGB codes +2: is 88 color mode, uses XTerm RGB codes +.TP +\(bu +3: is 256 color mode, uses XTerm RGB codes +.TP +\(bu +4: is true color mode, uses konsole RGB codes .LP .RE .IP .TP -terminal\&._template_\&.transparency [0|1] (default: 1) -If we should not set the background to black\&. This is particularly useful when we have a terminal (typically in some windowing environment) with a background image or a transparent background \- it will be visible in \fIELinks\fR as well\&. Note that this option makes sense only when colors are enabled\&. +terminal\&._template_\&.transparency [0|1] (default: 0) +If we should not set the background to black\&. This is particularly useful when we have a terminal (typically in some windowing environment) with a background image or a transparent background \- it will be visible in \fIELinks\fR as well (but \fIELinks\fR document color handling will still assume the background is black so if you have a bright background you might experience contrast problems)\&. Note that this option makes sense only when colors are enabled\&. .TP terminal\&._template_\&.underline [0|1] (default: 0) diff --git a/doc/man/man5/elinkskeys.5 b/doc/man/man5/elinkskeys.5 index fdeddf10..3ed21512 100644 --- a/doc/man/man5/elinkskeys.5 +++ b/doc/man/man5/elinkskeys.5 @@ -17,10 +17,10 @@ .el .ne 3 .IP "\\$1" \\$2 .. -.TH "ELINKSKEYS" 5 "ELinks keybindings" "2006-06-12" "ELinks keybindings" +.TH "ELINKSKEYS" 5 "ELinks keybindings" "2007-01-06" "ELinks keybindings" .SH NAME elinkskeys \- keybindings for ELinks -.SH "SYNOPSIS" +.SH "OVERVIEW" Information on how to configure keybinding and overview of the default keybindings\&. @@ -87,7 +87,7 @@ bind "main" "," = "lua\-console" Valid keys are: alphanumeric characters, punctuation, \fIEnter\fR, \fIBackspace\fR, \fITab\fR, \fIEscape\fR, \fILeft\fR, \fIRight\fR, \fIUp\fR, \fIDown\fR, \fIInsert\fR, \fIDelete\fR, \fIHome\fR, \fIEnd\fR, \fIPageUp\fR, \fIPageDown\fR, \fIF1\fR to \fIF12\fR\&. -Some keys will need to be quoted or escaped\&. For example, space can be written as " " (quote space quote), and the quote itself as \\" (backslash quote)\&. Backslash can be written as \\\\ (double backslash)\&. +Some keys will need to be quoted or escaped\&. For example, space can be written as " " (quote space quote), and the quote itself as \\" (backslash quote)\&. Backslash can be written as \e\e (double backslash)\&. .SH "KEYMAP ACTIONS" @@ -607,10 +607,22 @@ Delete to beginning of line\&. kill\-to\-eol Delete to end of line\&. +.TP +kill\-word\-back +Delete backwards to start of word\&. + .TP left Move the cursor left\&. +.TP +move\-backward\-word +Move cursor before current word\&. + +.TP +move\-forward\-word +Move cursor after current word\&. + .TP next\-item Move to the next item\&. @@ -806,7 +818,7 @@ Open download manager (\fIdownload\-manager\fR) .TP \fIE\fR -Open \\"Go to URL\\" dialog box containing the current link URL (\fIgoto\-url\-current\-link\fR) +Open "Go to URL" dialog box containing the current link URL (\fIgoto\-url\-current\-link\fR) .TP \fICtrl\-E\fR @@ -822,7 +834,7 @@ Move downwards by a page (\fImove\-page\-down\fR) .TP \fIG\fR -Open \\"Go to URL\\" dialog box containing the current URL (\fIgoto\-url\-current\fR) +Open "Go to URL" dialog box containing the current URL (\fIgoto\-url\-current\fR) .TP \fIH\fR @@ -881,7 +893,7 @@ Scroll left (\fIscroll\-left\fR) Go at a specified mark (\fImark\-goto\fR) .TP -\fI\\\fR +\fI\e\fR Toggle rendering page as HTML / plain text (\fItoggle\-html\-plain\fR) .TP @@ -914,7 +926,7 @@ Maximize the current frame (\fIframe\-maximize\fR) .TP \fIg\fR -Open \\"Go to URL\\" dialog box (\fIgoto\-url\fR) +Open "Go to URL" dialog box (\fIgoto\-url\fR) .TP \fIh\fR @@ -1060,6 +1072,10 @@ Move to the next frame (\fIframe\-next\fR) \fIAlt\-Tab\fR Move to the previous frame (\fIframe\-prev\fR) +.TP +\fITab\fR +Move to the previous frame (\fIframe\-prev\fR) + .TP \fIUp\fR Move to the previous link (\fImove\-link\-prev\fR) @@ -1078,6 +1094,10 @@ Go to the last line of the buffer (\fIend\-of\-buffer\fR) \fICtrl\-A\fR Go to the start of the page/line (\fIhome\fR) +.TP +\fIAlt\-b\fR +Move cursor before current word (\fImove\-backward\-word\fR) + .TP \fICtrl\-D\fR Delete character under cursor (\fIdelete\fR) @@ -1086,6 +1106,10 @@ Delete character under cursor (\fIdelete\fR) \fICtrl\-E\fR Go to the end of the page/line (\fIend\fR) +.TP +\fIAlt\-f\fR +Move cursor after current word (\fImove\-forward\-word\fR) + .TP \fICtrl\-H\fR Delete character in front of the cursor (\fIbackspace\fR) @@ -1130,6 +1154,10 @@ Attempt to auto\-complete the input (\fIauto\-complete\fR) \fICtrl\-X\fR Delete text from clipboard (\fIcut\-clipboard\fR) +.TP +\fIAlt\-Backspace\fR +Delete backwards to start of word (\fIkill\-word\-back\fR) + .TP \fIBackspace\fR Delete character in front of the cursor (\fIbackspace\fR) @@ -1182,6 +1210,10 @@ Move to the next item (\fInext\-item\fR) \fIAlt\-Tab\fR Move to the previous item (\fIprevious\-item\fR) +.TP +\fITab\fR +Move to the previous item (\fIprevious\-item\fR) + .TP \fIUp\fR Move cursor upwards (\fIup\fR) @@ -1312,6 +1344,10 @@ Move to the next item (\fInext\-item\fR) \fIAlt\-Tab\fR Move to the previous item (\fIprevious\-item\fR) +.TP +\fITab\fR +Move to the previous item (\fIprevious\-item\fR) + .TP \fIUp\fR Move cursor upwards (\fIup\fR) diff --git a/doc/manual.txt b/doc/manual.txt index 9cdbc3a5..ee3af56e 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -8,7 +8,7 @@ Welcome! This is the entry point for the humble ELinks manual. It is by no means complete, it is not even very homogeneous and it should eventually be superseded by a complete ELinks Book. Until this happens you may also find it necessary to refer to the manual page for a very quick reference, or the -built-in documentation available via the --long-help and --config-help ELinks +built-in documentation available via the \--long-help and \--config-help ELinks command-line arguments. The built-in documentation is sure to be up-to-date. There was a complete (or, for the most part complete) manual for Links 0.82 at diff --git a/doc/python.txt b/doc/python.txt index baf81357..62707ed7 100644 --- a/doc/python.txt +++ b/doc/python.txt @@ -37,24 +37,24 @@ FUNCTIONS follow_url_hook(url) Rewrite a URL for a link that's about to be followed. - This function should return a URL for ELinks to follow, or None if + This function should return a string containing a URL for ELinks to + follow, or an empty string if no URL should be followed, or None if ELinks should follow the original URL. Arguments: url -- The URL of the link. - goto_url_hook(url, current_url) + goto_url_hook(url) Rewrite a URL that was entered in a "Go to URL" dialog box. - This function should return a URL for ELinks to follow, or None if + This function should return a string containing a URL for ELinks to + follow, or an empty string if no URL should be followed, or None if ELinks should follow the original URL. Arguments: url -- The URL provided by the user. - current_url -- The URL of the document being viewed, or None if no - document is being viewed. pre_format_html_hook(url, html) Rewrite the body of a document before it's formatted. diff --git a/doc/small.txt b/doc/small.txt index 035874de..6ee41705 100644 --- a/doc/small.txt +++ b/doc/small.txt @@ -41,11 +41,11 @@ You can disable bookmarks, globhist and more, too, if you want to. [NOTE] .Notes =============================================================================== - - --disable-backtrace disables internal backtrace code. - - --disable-nls disables i18n support. - - --enable-fastmem disables internal `malloc()` debugging and use `alloca()` + - \--disable-backtrace disables internal backtrace code. + - \--disable-nls disables i18n support. + - \--enable-fastmem disables internal `malloc()` debugging and use `alloca()` wherever possible. - - --enable-small forces to remove some text descriptions in options and + - \--enable-small forces to remove some text descriptions in options and keybind stuff (regain 30Kb). =============================================================================== @@ -54,15 +54,15 @@ options: `-----------------------`------------------------------------------------------ Option Description ------------------------------------------------------------------------------- ---without-zlib removes libz dependency (compression) ---without-bzlib removes libbz2 dependency (compression) ---disable-xbel removes expat dependency (XBEL bookmarks support) ---without-lua removes liblua dependency (Lua scripting) ---without-gnutls removes libtls dependency (SSL support) ---without-openssl removes libssl dependency (SSL support) ---without-x removes libx11 dependency (restoring terminal title) ---without-spidermonkey removes libjs dependency (JavaScript) ---without-gpm removes libgpm dependency (mouse/console) +\--without-zlib removes libz dependency (compression) +\--without-bzlib removes libbz2 dependency (compression) +\--disable-xbel removes expat dependency (XBEL bookmarks support) +\--without-lua removes liblua dependency (Lua scripting) +\--without-gnutls removes libtls dependency (SSL support) +\--without-openssl removes libssl dependency (SSL support) +\--without-x removes libx11 dependency (restoring terminal title) +\--without-spidermonkey removes libjs dependency (JavaScript) +\--without-gpm removes libgpm dependency (mouse/console) ------------------------------------------------------------------------------- It seems GCC 2.95.x do not generate as small binaries as GCC 3.2.x with same @@ -82,7 +82,7 @@ Here are some results using gcc 2.95.3, dietlibc-0.23, and previous flags: Whow ! Around 200kb :) [NOTE] -.Details about the `--enable-small` configure option effects: +.Details about the `\--enable-small` configure option effects: ============================================================================== - it disables long descriptions of options; - it disables textual descriptions of keybinding options; diff --git a/doc/tinycc.txt b/doc/tinycc.txt new file mode 100644 index 00000000..d81fe58d --- /dev/null +++ b/doc/tinycc.txt @@ -0,0 +1,187 @@ +Compiling ELinks with Tiny C Compiler +===================================== + +ELinks has been successfully compiled with http://www.tinycc.org/[Tiny +C Compiler] version 0.9.23, however there are several problems. +This file lists some of these problems and their possible solutions. + +Perl uses unsupported -Wl,-E +---------------------------- + +---------------------------------------------------------------------- +checking for Perl... no +---------------------------------------------------------------------- + +`config.log` reveals: + +---------------------------------------------------------------------- +configure:18039: checking for Perl +configure:18082: tcc -o conftest ... -rdynamic conftest.c -Wl,-E ... -lperl ... >&5 +tcc: unsupported linker option '-E' +configure:18088: $? = 1 +... +configure:18106: result: no +---------------------------------------------------------------------- + +The `-Wl,-E` option comes from this command: + +---------------------------------------------------------------------- +perl -MExtUtils::Embed -e ldopts +---------------------------------------------------------------------- + +TCC 0.9.23 does not support the option, so ELinks builds without Perl. + +Python uses unsupported -Xlinker -export-dynamic +------------------------------------------------ + +---------------------------------------------------------------------- +checking for Python... yes +checking for python... /usr/bin/python +... +Browser scripting ............... Guile, Lua, SpiderMonkey +---------------------------------------------------------------------- + +`config.log` reveals: + +---------------------------------------------------------------------- +configure:18204: checking for Python +configure:18208: result: yes +configure:18219: checking for python +configure:18237: found /usr/bin/python +configure:18250: result: /usr/bin/python +configure:18287: tcc -o conftest ... -rdynamic conftest.c -Xlinker -export-dynamic ... -lpython2.3 ... >&5 +tcc: invalid option -- '-Xlinker' +configure:18293: $? = 1 +---------------------------------------------------------------------- + +The `-Xlinker -export-dynamic` options come from this command: + +---------------------------------------------------------------------- +python -c 'from distutils import sysconfig; print sysconfig.get_config_var("LINKFORSHARED")' +---------------------------------------------------------------------- + +TCC 0.9.23 does not support `-Xlinker`, so ELinks builds without +Python. + +Ruby uses unsupported -Wl,-export-dynamic +----------------------------------------- + +---------------------------------------------------------------------- +checking for Ruby... yes +checking for ruby... /usr/bin/ruby +checking Ruby version... 1.8.3 +checking for Ruby header files... /usr/lib/ruby/1.8/i486-linux +configure: error: Ruby not found +---------------------------------------------------------------------- + +`config.log` reveals: + +---------------------------------------------------------------------- +configure:18617: checking for Ruby +configure:18641: result: yes +configure:18653: checking for ruby +configure:18671: found /usr/bin/ruby +configure:18684: result: /usr/bin/ruby +configure:18694: checking Ruby version +configure:18698: result: 1.8.3 +configure:18701: checking for Ruby header files +configure:18706: result: /usr/lib/ruby/1.8/i486-linux +configure:18765: tcc -o conftest ... -rdynamic -Wl,-export-dynamic ... conftest.c -lruby1.8 ... >&5 +tcc: unsupported linker option '-export-dynamic' +configure:18771: $? = 1 +configure:18808: error: Ruby not found +---------------------------------------------------------------------- + +The `-rdynamic -Wl,-export-dynamic` options come from this command: + +---------------------------------------------------------------------- +ruby -r rbconfig -e 'print Config::CONFIG["LDFLAGS"]' +---------------------------------------------------------------------- + +TCC 0.9.23 supports the former but not the latter. To work around the +error, configure `\--without-ruby`. + +Stabs entry has invalid string index +------------------------------------ + +---------------------------------------------------------------------- +ld -r -o lib.o frames.o parser.o renderer.o tables.o parser/lib.o +ld: parser/lib.o(.stab+0x2688): Stabs entry has invalid string index. +parser/lib.o: could not read symbols: Bad value +---------------------------------------------------------------------- + +Apparently, GNU ld 2.16.91 does not like the debug information +generated by TCC 0.9.23. To work around the error, either set +`LD=tcc` or remove `-g` from `CFLAGS`. + +Linker segfault +--------------- + +If you configure ELinks with both `\--with-gnutls` and `\--with-guile`, +TCC 0.9.23 crashes when it's trying to link ELinks. + +http://bugs.debian.org/418360[Debian bug #418360] has a patch that +fixes this. + +Undefined symbol alloca +----------------------- + +---------------------------------------------------------------------- + [LINK] src/elinks +tcc: undefined symbol 'alloca' +---------------------------------------------------------------------- + +GNU libc 2.3.6 declares `alloca()` in `` but does not +actually define it as a function, perhaps because the definition must +be specific to each compiler. TCC 0.9.23 does not define `alloca()` +either and fails to generate an executable but stupidly exits with +code 0. + +In ELinks, only `intl/gettext/plural.c` uses `alloca()`, so you can +avoid the error with `configure --disable-nls`. + +Unexpanded @HAVE_ALLOCA_H@ in +------------------------------------------ + +---------------------------------------------------------------------- +.../include/see/type.h:180: identifier expected +---------------------------------------------------------------------- + +`` of +http://www.adaptive-enterprises.com.au/~d/software/see/[Simple +ECMAScript Engine] 2.0.1131 has an unexpanded `@HAVE_ALLOCA_H@` inside +`#ifndef __GNUC__`. Of course, TCC 0.9.23 does not define `__GNUC__`, +so an error results. To avoid the error, either configure ELinks +`\--without-see`, or edit ``. + +Reported as +http://www.adaptive-enterprises.com.au/bugs/show_bug.cgi?id=65[SEE bug 65]. + +Advanced: Compiling SEE with TCC +-------------------------------- + +If you want even more problems, try compiling Simple ECMAScript Engine +with Tiny C Compiler as well. + +Wrong precedence of sizeof +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +---------------------------------------------------------------------- +.../see-2.0.1131/libsee/unicase.c:86: pointer expected +---------------------------------------------------------------------- + +TCC 0.9.23 misparses `sizeof (a)[0]` used in the `lengthof` macro. +To work around the bug, change it to `sizeof ((a)[0])`. + +Reported as http://bugs.debian.org/419203[Debian bug #419203]. + +Linker option -soname not supported +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +---------------------------------------------------------------------- +tcc: invalid option -- '-soname' +---------------------------------------------------------------------- + +To construct a proper ELF library, the build system of SEE 2.0.1131 +must specify the shared object name. Unfortunately, TCC 0.9.23 does +not appear to support any such option. So, use some other linker. diff --git a/doc/tools/conf2doc b/doc/tools/conf2doc index 99034bb2..5d4a98f2 100755 --- a/doc/tools/conf2doc +++ b/doc/tools/conf2doc @@ -73,7 +73,8 @@ cat "$CONFFILE" | while read line; do # Ignore ;; "#"*) - line=$(strip_comment "$line") + # Backslashify --help, --enable, --disable to avoid —. + line=$(strip_comment "$line" | sed 's/ --\([hed]\)/ \\--\1/') echo "$line" >> $TMPFILE ;; esac diff --git a/doc/tools/keys2doc b/doc/tools/keys2doc index 5e95eebc..1618e9c2 100755 --- a/doc/tools/keys2doc +++ b/doc/tools/keys2doc @@ -78,8 +78,11 @@ print_keymap_defaults() key=$(echo "$entry" | sed "s/\(KBD_[^,]*\|'.*'\),.*/\1/") modifier=$(echo "$entry" | sed "s/.*KBD_MOD_\([A-Z_]*\).*/\1/") action=$(echo "$entry" | sed "s/.*,.*\(ACT_$KEYMAP\)_\([A-Z_]*\).*/\2/") + # If there are backslashed quotes, remove the backslashes. + # (This is not needed in print_keymap_actions because + # there the "read" command consumes the backslashes.) action=$(grep " $action," "$CONFIGDIR/actions-$keymap.inc" \ - | sed "s/.*\"\([^\"]*\)\".*N__(\"\(.*\)\").*/\2 ('\1')/") + | sed "s/.*\"\([^\"]*\)\".*N__(\"\(.*\)\").*/\2 ('\1')/;s/\\\\\"/\"/g") case "$key" in KBD_*) diff --git a/features.conf b/features.conf index 0a756f74..fcdfe511 100644 --- a/features.conf +++ b/features.conf @@ -368,16 +368,14 @@ CONFIG_NNTP=no ### SMB Protocol Support # -# ELinks supports browsing over the SMB protocol (URI 'smb' scheme), using the -# smbclient program as back-end. Therefore, in order to have this enabled, you -# will need to install Samba (or at least just the smbclient part, if you can -# install it separately). +# ELinks supports browsing over the SMB protocol (URI 'smb' scheme), +# using the libsmbclient library as back-end. Therefore, in order to +# have this enabled, you will need to install Samba (or at least just +# the libsmbclient part, if you can install it separately). # -# Unfortunately, ELinks doesn't yet properly validate the file name passed to -# smbclient, and this caused vulnerability CVE-2006-5925 (bug 841). To close -# the vulnerability, configure.in now disables the SMB protocol regardless -# of what you specify here. If you would like to fix the code so that the -# protocol can be safely enabled again, please see bug 844. +# This use of libsmbclient is believed to be immune to the command +# injection attacks (CVE-2006-5925, bug 841) from which earlier ELinks +# releases (0.9.0 to 0.11.1) suffered. # # Default: disabled diff --git a/po/Makefile b/po/Makefile index 4d76c8d8..bc51f977 100644 --- a/po/Makefile +++ b/po/Makefile @@ -57,7 +57,25 @@ $(srcdir)$(PACKAGE).pot: $(srcdir)$(POTFILES_ABS_LIST) $(srcdir)perl/gather-acce $(XGETTEXT) --default-domain=$(PACKAGE) \ --directory=$(top_srcdir) \ --add-comments --language=C \ - --keyword=_ --keyword=N_ --keyword=n_:1,2 --keyword=N__ -f $(srcdir)$(POTFILES_ABS_LIST) \ + --keyword=_ --keyword=N_ --keyword=n_:1,2 --keyword=N__ \ + --flag=msg_text:2:c-format --flag=die:1:c-format \ + --flag=secure_fprintf:2:c-format \ + --flag=DBG:1:c-format --flag=elinks_debug:1:c-format \ + --flag=WDBG:1:c-format --flag=elinks_wdebug:1:c-format \ + --flag=ERROR:1:c-format --flag=elinks_error:1:c-format \ + --flag=INTERNAL:1:c-format --flag=elinks_internal:1:c-format \ + --flag=usrerror:1:c-format --flag=elinks_log:4:c-format \ + --flag=LOG_ERR:1:c-format --flag=LOG_WARN:1:c-format \ + --flag=LOG_INFO:1:c-format --flag=LOG_DBG:1:c-format \ + --flag=assertm:2:c-format --flag=elinks_assertm:2:c-format \ + --flag=add_format_to_string:2:c-format \ + --flag=elinks_vsnprintf:3:c-format --flag=elinks_snprintf:3:c-format \ + --flag=elinks_vasprintf:2:c-format --flag=elinks_asprintf:2:c-format \ + --flag=vasprintfa:1:c-format --flag=asprintfa:1:c-format \ + --flag=_:1:pass-c-format --flag=N_:1:pass-c-format \ + --flag=n_:1:pass-c-format --flag=n_:2:pass-c-format \ + --flag=N__:1:pass-c-format \ + -f $(srcdir)$(POTFILES_ABS_LIST) \ && test -f $(PACKAGE).po \ && $(PERL) -I"$(srcdir)perl" $(srcdir)perl/gather-accelerator-contexts.pl -S"$(top_srcdir)" $(PACKAGE).po \ && mv -f $(PACKAGE).po $(srcdir)$(PACKAGE).pot @@ -71,7 +89,6 @@ $(srcdir)$(PACKAGE).pot: $(srcdir)$(POTFILES_ABS_LIST) $(srcdir)perl/gather-acce # either or .po when calling make. Example: make update-po PO=is update-po: Makefile $(srcdir)$(PACKAGE).pot - @test -z "$(srcdir)" || cd $(srcdir) @$(foreach lang,$(basename $(if $(strip $(PO)),$(PO),$(GMOFILES))), \ echo -n "$(lang): "; \ if $(MSGMERGE) $(srcdir)$(lang).po $(srcdir)$(PACKAGE).pot -o $(lang).new.po; then \ diff --git a/po/de.po b/po/de.po index bed9b81d..3cb70e1c 100644 --- a/po/de.po +++ b/po/de.po @@ -4,14 +4,15 @@ # Josef 'Jupp' Schugt , 2003 # Karsten 'kuser' Schölzel # Thomas Fuchs +# Jens Seidel # msgid "" msgstr "" "Project-Id-Version: ELinks 0.9.CVS\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-02-19 00:03+0100\n" -"PO-Revision-Date: 2004-08-15 17:19+0200\n" -"Last-Translator: Thomas Fuchs \n" +"PO-Revision-Date: 2005-06-14 20:52+0200\n" +"Last-Translator: Jens Seidel \n" "Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-15\n" @@ -1298,7 +1299,7 @@ msgstr "" #: src/config/cmdline.c:666 msgid "Name of directory with configuration file" -msgstr "Name des Verzeichnises mit der Konfigurations-Datei" +msgstr "Name des Verzeichnisses mit der Konfigurations-Datei" #: src/config/cmdline.c:668 #, fuzzy @@ -1477,7 +1478,7 @@ msgstr "" #: src/config/cmdline.c:750 msgid "Run as separate instance" -msgstr "Starte als seperater Prozess" +msgstr "Starte als separater Prozess" #: src/config/cmdline.c:752 #, fuzzy @@ -1487,7 +1488,7 @@ msgid "" "(bookmarks, history, etc.) are written to the disk when this\n" "option is used. See also -touch-files." msgstr "" -"Starte ELinks als seperate Instanz und verbinde nicht zu einer\n" +"Starte ELinks als separate Instanz und verbinde nicht zu einer\n" "laufenden Instanz. Beachte, dass normalerweise keine Statusdateien\n" "(Lesezeichen, Verlauf, usw.) geschrieben werden, wenn diese Option\n" "benutzt wird. Siehe auch -touch-files." @@ -2384,11 +2385,11 @@ msgstr "" #: src/config/options.inc:234 msgid "Image link prefix" -msgstr "Prefix von Links zu Bildern" +msgstr "Präfix von Links zu Bildern" #: src/config/options.inc:236 msgid "Prefix string to use to mark image links." -msgstr "Prefix, um Links zu Bildern zu kennzeichnen." +msgstr "Präfix, um Links zu Bildern zu kennzeichnen." #: src/config/options.inc:238 msgid "Image link suffix" @@ -2598,7 +2599,7 @@ msgid "" "1 means if document.browse.links.numbering = 1\n" "2 means always" msgstr "" -"Ziffertasten wählen Links aus und bezeichnen keine Kommandoprefixe.\n" +"Ziffertasten wählen Links aus und bezeichnen keine Kommandopräfixe.\n" "Diese Option hat drei Zustände:\n" "0 niemals\n" "1 wenn document.browse.links.numbering = 1\n" @@ -2648,7 +2649,7 @@ msgid "" "right is pressed and no prefix was given." msgstr "" "Anzahl der zu rollenden Zeilen, wenn eine mit scroll-up oder scroll-\n" -"down verbundene Taste gedrückt und kein Prefix angegeben wurde." +"down verbundene Taste gedrückt und kein Präfix angegeben wurde." #: src/config/options.inc:366 msgid "Extended horizontal scrolling" @@ -2683,7 +2684,7 @@ msgid "" "down is pressed and no prefix was given." msgstr "" "Anzahl der zu rollenden Zeilen, wenn eine mit scroll-up oder scroll-\n" -"down verbundene Taste gedrückt und kein Prefix angegeben wurde." +"down verbundene Taste gedrückt und kein Präfix angegeben wurde." #: src/config/options.inc:383 msgid "Searching" @@ -2695,7 +2696,7 @@ msgstr "Optionen f #: src/config/options.inc:387 msgid "Case sensitivity" -msgstr "Groß-/Kleinscreibung beachten" +msgstr "Groß-/Kleinschreibung beachten" #: src/config/options.inc:389 msgid "" @@ -4630,7 +4631,7 @@ msgstr "Hintergrund" #: src/dialogs/download.c:246 #, fuzzy msgid "Background with ~notify" -msgstr "Im Hintergund mit Benachrichtigung" +msgstr "Im Hintergrund mit Benachrichtigung" #. accelerator_context(display_download, src/dialogs/download.c:download_buttons) #: src/dialogs/download.c:253 src/dialogs/download.c:481 @@ -4836,12 +4837,12 @@ msgstr "Linknummer eingeben" #: src/dialogs/info.c:239 #, fuzzy msgid "master terminal" -msgstr "Terminalgrösse ändern" +msgstr "Terminalgröße ändern" #: src/dialogs/info.c:241 #, fuzzy msgid "slave terminal" -msgstr "Terminalgrösse ändern" +msgstr "Terminalgröße ändern" #: src/dialogs/info.c:245 #, fuzzy, c-format @@ -5027,7 +5028,7 @@ msgstr "~Starte Shell" #. accelerator_context(src/dialogs/menu.c:file_menu) #: src/dialogs/menu.c:388 msgid "Resize t~erminal" -msgstr "Terminalgrösse ~ändern" +msgstr "Terminalgröße ~ändern" #. accelerator_context(src/dialogs/menu.c:view_menu) #: src/dialogs/menu.c:406 @@ -5334,7 +5335,7 @@ msgstr "256 Farben" #: src/dialogs/options.c:286 msgid "Resize terminal" -msgstr "Terminalgrösse ändern" +msgstr "Terminalgröße ändern" #: src/dialogs/options.c:289 #, fuzzy @@ -7768,14 +7769,14 @@ msgid "" "arguments to them like search engine keywords." msgstr "" "Regeln um URIs zu verändern, die im Gehe-zu-Dialog eingegeben werden.\n" -"Hiermit ist es möglich, Prefixe zu definieren, die bei Eingabe im\n" -"Gehe-zu-Dialog expandiert werden. Die Prefixe können einfach sein,\n" +"Hiermit ist es möglich, Präfixe zu definieren, die bei Eingabe im\n" +"Gehe-zu-Dialog expandiert werden. Die Präfixe können einfach sein,\n" "das heißt sie verhalten sich wie URI-Abkürzungen, oder komplex sein,\n" "dann können Argumente angegeben werden wie zum Beispiel Suchbegriffe." #: src/protocol/rewrite/rewrite.c:53 msgid "Enable dumb prefixes" -msgstr "Einfache Prefixe aktivieren" +msgstr "Einfache Präfixe aktivieren" #: src/protocol/rewrite/rewrite.c:55 #, fuzzy @@ -7785,14 +7786,14 @@ msgid "" "if you write 'elinks' there, you are directed to\n" "http://elinks.cz/." msgstr "" -"Aktiviert einfache Prefixe. Dabei handelt es sich um URI Abkürzungen,\n" +"Aktiviert einfache Präfixe. Dabei handelt es sich um URI-Abkürzungen,\n" "die in den Gehe-Zu-URL-Dialog geschrieben werden anstelle der \n" "aktuellen URI. Z.B. kann man dort 'elinks' eingeben und wird auf\n" "http://elinks.or.cz/ umgeleitet." #: src/protocol/rewrite/rewrite.c:60 msgid "Enable smart prefixes" -msgstr "Komplexe Prefixe aktivieren" +msgstr "Komplexe Präfixe aktivieren" #: src/protocol/rewrite/rewrite.c:62 msgid "" @@ -7801,18 +7802,18 @@ msgid "" "of arguments from which the actual URI is composed - i.e.\n" "'gg:search keywords' or 'gn search keywords for news'." msgstr "" -"Aktiviert komplexe Prefixe. Dabei handelt es sich um Abkürzungen\n" +"Aktiviert komplexe Präfixe. Dabei handelt es sich um Abkürzungen\n" "für URI-Schablonen, die gefolgt von einer Liste von Argumenten\n" "in den Gehe-zu-Dialog eingegeben werden und aus denen die Ziel-URL\n" "zusammengesetzt wird. Z.B. 'gg Suchwörter' oder 'gn Suchwörter für News'." #: src/protocol/rewrite/rewrite.c:67 msgid "Dumb Prefixes" -msgstr "Einfache Prefixe" +msgstr "Einfache Präfixe" #: src/protocol/rewrite/rewrite.c:69 msgid "Dumb prefixes, see enable-dumb description for details." -msgstr "Einfach Prefixe, siehe enable-dump-Beschreibung für Details." +msgstr "Einfach Präfixe, siehe enable-dump-Beschreibung für Details." #: src/protocol/rewrite/rewrite.c:74 #, fuzzy, no-c-format @@ -7821,17 +7822,17 @@ msgid "" "%c in the string means the current URL\n" "%% in the string means '%'" msgstr "" -"Ersatz-URI für dieses einfache Prefix.\n" +"Ersatz-URI für dieses einfache Präfix.\n" "%c in der Zeichenkette bedeutet die aktuelle URL\n" "%% in der Zeichenkette bedeutet '%'" #: src/protocol/rewrite/rewrite.c:78 msgid "Smart Prefixes" -msgstr "Komplexe Prefixe" +msgstr "Komplexe Präfixe" #: src/protocol/rewrite/rewrite.c:80 msgid "Smart prefixes, see enable-smart description for details." -msgstr "Komplexe Prefixe, siehe enable-smart-Besschreibung für Details." +msgstr "Komplexe Präfixe, siehe enable-smart-Beschreibung für Details." #: src/protocol/rewrite/rewrite.c:87 #, fuzzy, no-c-format @@ -7842,9 +7843,9 @@ msgid "" "%0,%1,...,%9 means argument 0, 1, ..., 9\n" "%% in the string means '%'" msgstr "" -"Ersatz-URI für dieses komplexe Prefix.\n" +"Ersatz-URI für dieses komplexe Präfix.\n" "%c in der Zeichenkette bedeutet die aktuelle URL\n" -"%s in der Zeichenkette bedeutet das gesamte Argument dieses Prefixes\n" +"%s in der Zeichenkette bedeutet das gesamte Argument dieses Präfixes\n" "%0,%1,...,%9 in der Zeichenkette bedeutet Argument 0, 1, ..., 9\n" "%% in der Zeichenkette bedeutet '%'" @@ -8114,7 +8115,7 @@ msgid "" "for any inconvience caused." msgstr "" "Der Wert der Option config.saving_style ist de facto veraltet. Die " -"Algorithmen für das Speichern der Konfiguartion haben sich im Vergleich zu " +"Algorithmen für das Speichern der Konfiguration haben sich im Vergleich zu " "deiner letzten ELinks-Version verändert. Jetzt werden nur noch diejenigen " "Optionen gespeichert, die sich geändert haben, anstatt aller Optionen. Dies " "vereinfacht unsere Situation, wenn eine Option einen ungültigen Wert hat " @@ -8586,8 +8587,8 @@ msgstr "Fehler beim Schreiben in Datei" #~ "Prefix: Shift, Ctrl, Alt\n" #~ "Key: a,b,c,...,1,2,3,...,Space,Up,PageDown,Tab,Enter,Insert,F5,..." #~ msgstr "" -#~ "Geben Sie Tastendrücke in dieser Form ein: [Prefix-]Taste\n" -#~ "Prefix: Shift, Ctrl, Alt\n" +#~ "Geben Sie Tastendrücke in dieser Form ein: [Präfix-]Taste\n" +#~ "Präfix: Shift, Ctrl, Alt\n" #~ "Taste: a,b,c,...,1,2,3,...,Space,Up,PageDown,Tab,Enter,Insert,F5,..." #, fuzzy diff --git a/po/fr.po b/po/fr.po index 16f3f6c2..998c525f 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1,13 +1,13 @@ # French ELinks translation. # Fabrice Haberer-Proust -# Laurent Monin , 2001 - 2006 +# Laurent Monin , 2001 - 2007 # msgid "" msgstr "" "Project-Id-Version: ELinks 0.12.GIT\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-12-07 09:57+0100\n" -"PO-Revision-Date: 2006-12-07 09:59+0100\n" +"POT-Creation-Date: 2007-03-23 18:35+0100\n" +"PO-Revision-Date: 2007-03-23 18:37+0100\n" "Last-Translator: Laurent Monin \n" "Language-Team: French \n" "MIME-Version: 1.0\n" @@ -32,13 +32,13 @@ msgstr "Pressez espace pour d #. accelerator_context(do_auth_dialog, do_edit_dialog, generic_external_protocol_handler, info_box, input_dialog, menu_add_ext, menu_keys, push_hierbox_info_button, python_info_box, refreshed_msg_box, resize_terminal_dialog, setup_first_session, src/config/dialogs.c:build_edit_dialog, src/cookies/dialogs.c:build_edit_dialog, src/cookies/dialogs.c:push_add_server_button, src/scripting/lua/core.c:l_edit_bookmark_dialog, src/scripting/lua/core.c:l_xdialog, src/viewer/text/search.c:search_dlg_do, terminal_options, write_config_dialog) #: src/bfu/hierbox.c:441 src/bfu/inpfield.c:256 src/bfu/msgbox.c:173 -#: src/bfu/msgbox.c:191 src/config/dialogs.c:58 src/config/dialogs.c:393 -#: src/cookies/dialogs.c:356 src/cookies/dialogs.c:454 src/dialogs/edit.c:98 -#: src/dialogs/info.c:134 src/dialogs/options.c:234 src/dialogs/options.c:315 +#: src/bfu/msgbox.c:194 src/config/dialogs.c:57 src/config/dialogs.c:365 +#: src/cookies/dialogs.c:372 src/cookies/dialogs.c:470 src/dialogs/edit.c:98 +#: src/dialogs/info.c:134 src/dialogs/options.c:232 src/dialogs/options.c:313 #: src/mime/dialogs.c:131 src/protocol/auth/dialogs.c:115 #: src/protocol/protocol.c:236 src/scripting/lua/core.c:390 #: src/scripting/lua/core.c:471 src/scripting/python/dialogs.c:86 -#: src/session/session.c:812 src/viewer/text/search.c:1666 +#: src/session/session.c:807 src/viewer/text/search.c:1669 msgid "~OK" msgstr "~OK" @@ -119,34 +119,34 @@ msgid "Delete error" msgstr "Erreur de suppression" #. accelerator_context(close_all_tabs_but_current, close_tab, memorize_form, menu_del_ext, push_hierbox_clear_button, push_hierbox_delete_button, query_delete_selected_item, query_exit, ses_goto, src/config/dialogs.c:really_add_keybinding.yn) -#: src/bfu/hierbox.c:754 src/bfu/hierbox.c:766 src/bfu/hierbox.c:808 -#: src/bfu/hierbox.c:870 src/config/dialogs.c:851 src/dialogs/menu.c:127 -#: src/formhist/formhist.c:419 src/mime/dialogs.c:70 src/session/task.c:273 -#: src/terminal/tab.c:206 src/terminal/tab.c:249 +#: src/bfu/hierbox.c:754 src/bfu/hierbox.c:766 src/bfu/hierbox.c:814 +#: src/bfu/hierbox.c:876 src/config/dialogs.c:823 src/dialogs/menu.c:131 +#: src/formhist/formhist.c:432 src/mime/dialogs.c:70 src/session/task.c:277 +#: src/terminal/tab.c:207 src/terminal/tab.c:251 msgid "~Yes" msgstr "~Oui" #. accelerator_context(close_all_tabs_but_current, close_tab, memorize_form, menu_del_ext, push_hierbox_clear_button, push_hierbox_delete_button, query_delete_selected_item, query_exit, ses_goto, src/config/dialogs.c:really_add_keybinding.yn) -#: src/bfu/hierbox.c:755 src/bfu/hierbox.c:767 src/bfu/hierbox.c:809 -#: src/bfu/hierbox.c:871 src/config/dialogs.c:852 src/dialogs/menu.c:128 -#: src/formhist/formhist.c:420 src/mime/dialogs.c:71 src/session/task.c:274 -#: src/terminal/tab.c:207 src/terminal/tab.c:250 +#: src/bfu/hierbox.c:755 src/bfu/hierbox.c:767 src/bfu/hierbox.c:815 +#: src/bfu/hierbox.c:877 src/config/dialogs.c:824 src/dialogs/menu.c:132 +#: src/formhist/formhist.c:433 src/mime/dialogs.c:71 src/session/task.c:278 +#: src/terminal/tab.c:208 src/terminal/tab.c:252 msgid "~No" msgstr "~Non" -#: src/bfu/hierbox.c:939 src/bfu/hierbox.c:970 src/viewer/text/search.c:1085 -#: src/viewer/text/search.c:1093 src/viewer/text/search.c:1109 -#: src/viewer/text/search.c:1685 +#: src/bfu/hierbox.c:945 src/bfu/hierbox.c:976 src/viewer/text/search.c:1088 +#: src/viewer/text/search.c:1096 src/viewer/text/search.c:1112 +#: src/viewer/text/search.c:1688 msgid "Search" msgstr "Chercher" -#: src/bfu/hierbox.c:941 src/viewer/text/search.c:1086 +#: src/bfu/hierbox.c:947 src/viewer/text/search.c:1089 #, c-format msgid "Search string '%s' not found" msgstr "Chaîne recherchée '%s' introuvable" -#: src/bfu/hierbox.c:970 src/config/dialogs.c:169 src/config/dialogs.c:359 -#: src/config/dialogs.c:507 src/cookies/dialogs.c:34 src/cookies/dialogs.c:350 +#: src/bfu/hierbox.c:976 src/config/dialogs.c:140 src/config/dialogs.c:329 +#: src/config/dialogs.c:479 src/cookies/dialogs.c:34 src/cookies/dialogs.c:366 #: src/dialogs/edit.c:92 src/dialogs/edit.c:94 src/scripting/lua/core.c:386 #: src/scripting/lua/core.c:387 src/scripting/lua/core.c:468 msgid "Name" @@ -165,7 +165,7 @@ msgstr "Saisir un nombre" msgid "Number should be in the range from %d to %d." msgstr "Le nombre doit être compris entre %d et %d." -#: src/bfu/inpfield.c:99 src/config/dialogs.c:460 +#: src/bfu/inpfield.c:99 src/config/dialogs.c:432 msgid "Bad string" msgstr "Mauvaise chaîne" @@ -174,13 +174,13 @@ msgid "Empty string not allowed" msgstr "Chaîne vide non autorisée" #. accelerator_context(do_auth_dialog, do_edit_dialog, input_dialog, menu_add_ext, resize_terminal_dialog, src/config/dialogs.c:build_edit_dialog, src/cookies/dialogs.c:build_edit_dialog, src/cookies/dialogs.c:push_add_server_button, src/protocol/bittorrent/dialogs.c:bittorrent_query_callback, src/scripting/lua/core.c:l_edit_bookmark_dialog, src/scripting/lua/core.c:l_xdialog, src/session/download.c:do_type_query, src/session/download.c:lookup_unique_name, src/viewer/text/search.c:search_dlg_do, terminal_options) -#: src/bfu/inpfield.c:256 src/config/dialogs.c:394 src/cookies/dialogs.c:357 -#: src/cookies/dialogs.c:455 src/dialogs/edit.c:102 src/dialogs/edit.c:105 -#: src/dialogs/options.c:237 src/dialogs/options.c:316 src/mime/dialogs.c:132 +#: src/bfu/inpfield.c:256 src/config/dialogs.c:366 src/cookies/dialogs.c:373 +#: src/cookies/dialogs.c:471 src/dialogs/edit.c:102 src/dialogs/edit.c:105 +#: src/dialogs/options.c:235 src/dialogs/options.c:314 src/mime/dialogs.c:132 #: src/protocol/auth/dialogs.c:116 src/protocol/bittorrent/dialogs.c:812 #: src/scripting/lua/core.c:391 src/scripting/lua/core.c:472 -#: src/session/download.c:637 src/session/download.c:1243 -#: src/viewer/text/search.c:1667 +#: src/session/download.c:644 src/session/download.c:1266 +#: src/viewer/text/search.c:1670 msgid "~Cancel" msgstr "~Annuler" @@ -192,8 +192,8 @@ msgstr "Horloge" msgid "Digital clock in the status bar." msgstr "Horloge digitale dans la barre de status." -#: src/bfu/leds.c:77 src/bfu/leds.c:94 src/config/options.inc:1214 -#: src/config/options.inc:1221 src/ecmascript/ecmascript.c:45 +#: src/bfu/leds.c:77 src/bfu/leds.c:94 src/config/options.inc:1178 +#: src/config/options.inc:1185 src/ecmascript/ecmascript.c:45 #: src/globhist/globhist.c:64 src/mime/backend/mailcap.c:93 #: src/mime/backend/mimetypes.c:52 src/network/ssl/ssl.c:80 msgid "Enable" @@ -237,6 +237,7 @@ msgid "LED indicators" msgstr "Indicateurs LED" #: src/bfu/leds.c:306 +#, c-format msgid "" "What the different LEDs indicate:\n" "\n" @@ -269,6 +270,7 @@ msgid "Search menu/" msgstr "Chercher menu/" #: src/bookmarks/backend/xbel.c:97 +#, c-format msgid "read_bookmarks_xbel(): Error in XML_ParserCreate()" msgstr "read_bookmarks_xbel(): Erreur dans XML_ParserCreate()" @@ -367,7 +369,7 @@ msgstr "" "\n" "Cette fonctionnalité requiert le support des signets." -#: src/bookmarks/dialogs.c:72 src/config/options.inc:1066 +#: src/bookmarks/dialogs.c:72 src/config/options.inc:1030 #: src/dialogs/document.c:145 src/globhist/dialogs.c:65 msgid "Title" msgstr "Titre" @@ -477,22 +479,22 @@ msgid "~Goto" msgstr "A~ller à" #. accelerator_context(src/bookmarks/dialogs.c:bookmark_buttons, src/config/dialogs.c:option_buttons, src/cookies/dialogs.c:cookie_buttons) -#: src/bookmarks/dialogs.c:488 src/config/dialogs.c:531 -#: src/cookies/dialogs.c:476 +#: src/bookmarks/dialogs.c:488 src/config/dialogs.c:503 +#: src/cookies/dialogs.c:492 msgid "~Edit" msgstr "~Modifier" #. accelerator_context(src/bookmarks/dialogs.c:bookmark_buttons, src/cache/dialogs.c:cache_buttons, src/config/dialogs.c:keybinding_buttons, src/config/dialogs.c:option_buttons, src/cookies/dialogs.c:cookie_buttons, src/dialogs/menu.c:ext_menu, src/formhist/dialogs.c:formhist_buttons, src/globhist/dialogs.c:globhist_buttons, src/protocol/auth/dialogs.c:auth_buttons) #: src/bookmarks/dialogs.c:489 src/cache/dialogs.c:231 -#: src/config/dialogs.c:533 src/config/dialogs.c:960 src/cookies/dialogs.c:477 -#: src/dialogs/menu.c:457 src/formhist/dialogs.c:211 +#: src/config/dialogs.c:505 src/config/dialogs.c:932 src/cookies/dialogs.c:493 +#: src/dialogs/menu.c:461 src/formhist/dialogs.c:211 #: src/globhist/dialogs.c:229 src/protocol/auth/dialogs.c:263 msgid "~Delete" msgstr "~Supprimer" #. accelerator_context(src/bookmarks/dialogs.c:bookmark_buttons, src/config/dialogs.c:keybinding_buttons, src/config/dialogs.c:option_buttons, src/cookies/dialogs.c:cookie_buttons, src/dialogs/menu.c:ext_menu) -#: src/bookmarks/dialogs.c:490 src/config/dialogs.c:532 -#: src/config/dialogs.c:959 src/cookies/dialogs.c:474 src/dialogs/menu.c:455 +#: src/bookmarks/dialogs.c:490 src/config/dialogs.c:504 +#: src/config/dialogs.c:931 src/cookies/dialogs.c:490 src/dialogs/menu.c:459 msgid "~Add" msgstr "~Ajouter" @@ -513,7 +515,7 @@ msgstr "~D #. accelerator_context(src/bookmarks/dialogs.c:bookmark_buttons, src/cache/dialogs.c:cache_buttons, src/config/dialogs.c:keybinding_buttons, src/config/dialogs.c:option_buttons, src/dialogs/menu.c:view_menu, src/globhist/dialogs.c:globhist_buttons) #: src/bookmarks/dialogs.c:494 src/cache/dialogs.c:232 -#: src/config/dialogs.c:534 src/config/dialogs.c:962 src/dialogs/menu.c:408 +#: src/config/dialogs.c:506 src/config/dialogs.c:934 src/dialogs/menu.c:412 #: src/globhist/dialogs.c:230 msgid "~Search" msgstr "~Chercher" @@ -561,7 +563,7 @@ msgstr "URL du proxy" msgid "Redirect" msgstr "Redirection" -#: src/cache/dialogs.c:85 src/config/options.inc:518 +#: src/cache/dialogs.c:85 src/config/options.inc:519 #: src/dialogs/document.c:156 src/protocol/bittorrent/dialogs.c:126 msgid "Size" msgstr "Taille" @@ -599,7 +601,7 @@ msgid "invalid" msgstr "invalide" #: src/cache/dialogs.c:125 src/cookies/dialogs.c:40 src/cookies/dialogs.c:44 -#: src/cookies/dialogs.c:353 +#: src/cookies/dialogs.c:369 msgid "Expires" msgstr "Expiration" @@ -607,7 +609,7 @@ msgstr "Expiration" msgid "ID" msgstr "ID" -#: src/cache/dialogs.c:134 src/config/options.inc:722 +#: src/cache/dialogs.c:134 src/config/options.inc:669 msgid "Header" msgstr "En-tête" @@ -645,7 +647,7 @@ msgid "Delete this cache entry?" msgstr "Supprimer cette entrée de cache ?" #. accelerator_context(display_download, src/cache/dialogs.c:cache_buttons, src/config/dialogs.c:option_buttons, src/cookies/dialogs.c:cookie_buttons, src/dialogs/download.c:download_buttons, src/formhist/dialogs.c:formhist_buttons, src/globhist/dialogs.c:globhist_buttons, src/protocol/auth/dialogs.c:auth_buttons) -#: src/cache/dialogs.c:229 src/config/dialogs.c:530 src/cookies/dialogs.c:473 +#: src/cache/dialogs.c:229 src/config/dialogs.c:502 src/cookies/dialogs.c:489 #: src/dialogs/download.c:255 src/dialogs/download.c:492 #: src/formhist/dialogs.c:210 src/globhist/dialogs.c:225 #: src/protocol/auth/dialogs.c:262 @@ -693,8 +695,8 @@ msgid "Copy text to clipboard" msgstr "Copier le texte vers le tampon" #: src/config/actions-edit.inc:14 -msgid "Delete text from clipboard" -msgstr "Effacer le texte du tampon" +msgid "Cut text to clipboard" +msgstr "Couper le texte vers le tampon" #: src/config/actions-edit.inc:15 src/config/actions-menu.inc:9 msgid "Delete character under cursor" @@ -1134,8 +1136,8 @@ msgstr "Envoyer le formulaire" msgid "Submit form and reload" msgstr "Envoyer le formulaire et recharger" -#: src/config/actions-main.inc:101 src/terminal/tab.c:203 -#: src/terminal/tab.c:246 +#: src/config/actions-main.inc:101 src/terminal/tab.c:204 +#: src/terminal/tab.c:248 msgid "Close tab" msgstr "Fermer l'onglet" @@ -1250,15 +1252,18 @@ msgstr "Trop de param msgid "error" msgstr "erreur" -#: src/config/cmdline.c:164 src/network/state.c:47 +#: src/config/cmdline.c:164 src/network/state.c:48 +#, c-format msgid "Host not found" msgstr "Hôte introuvable" #: src/config/cmdline.c:178 +#, c-format msgid "Resolver error" msgstr "Erreur du résolveur" -#: src/config/cmdline.c:255 src/config/dialogs.c:83 src/network/state.c:46 +#: src/config/cmdline.c:255 src/cookies/cookies.c:868 src/network/state.c:47 +#: src/util/secsave.c:373 msgid "Out of memory" msgstr "Mémoire saturée" @@ -1725,7 +1730,7 @@ msgstr "Afficher la version et quitter" msgid "Print ELinks version information and exit." msgstr "Afficher la version d'ELinks et quitter." -#: src/config/conf.c:720 +#: src/config/conf.c:722 msgid "" "## This is ELinks configuration file. You can edit it manually,\n" "## if you wish so; this file is edited by ELinks when you save\n" @@ -1737,7 +1742,7 @@ msgstr "" "## des options, mais seules les valeurs des options seront\n" "## modifiées; votre formatage et commentaires seront préservés.\n" -#: src/config/conf.c:728 +#: src/config/conf.c:730 msgid "" "## This is ELinks configuration file. You can edit it manually,\n" "## if you wish so; this file is edited by ELinks when you save\n" @@ -1755,7 +1760,7 @@ msgstr "" "## dans un fichier inclus, l'option ne sera pas considérée comme\n" "## manquante. Votre formatage et commentaires seront préservés.\n" -#: src/config/conf.c:738 +#: src/config/conf.c:740 msgid "" "## This is ELinks configuration file. You can edit it manually,\n" "## if you wish so, but keep in mind that this file is overwritten\n" @@ -1768,7 +1773,7 @@ msgstr "" "## des options, votre formatage et commentaires peuvent ne pas\n" "## être préservés.\n" -#: src/config/conf.c:749 +#: src/config/conf.c:751 msgid "" "## Obviously, if you don't like what ELinks is going to do with\n" "## this file, you can change it by altering the config.saving_style\n" @@ -1777,65 +1782,33 @@ msgstr "" "## Evidemment, si vous n'aimez pas ce que ELinks fait avec ce fichier,\n" "## vous pouvez modifier la valeur de l'option config.saving_style.\n" -#: src/config/conf.c:762 +#: src/config/conf.c:764 msgid "Automatically saved options\n" msgstr "Options sauvées automatiquement\n" -#: src/config/conf.c:774 +#: src/config/conf.c:776 msgid "Automatically saved keybindings\n" msgstr "Associations de touches sauvées automatiquement\n" -#: src/config/dialogs.c:54 +#: src/config/dialogs.c:53 msgid "Write config success" msgstr "Succès d'écriture de configuration" -#: src/config/dialogs.c:55 +#: src/config/dialogs.c:54 #, c-format msgid "Options were saved successfully to config file %s." msgstr "Les options ont été sauvées avec succès dans le fichier %s." #. accelerator_context(write_config_dialog) -#: src/config/dialogs.c:59 +#: src/config/dialogs.c:58 msgid "~Do not show anymore" msgstr "~Ne plus montrer" -#: src/config/dialogs.c:65 -msgid "Cannot read the file" -msgstr "Échec de lecture du fichier" - -#: src/config/dialogs.c:68 -msgid "Cannot get file status" -msgstr "Impossible d'obtenir l'état du fichier" - -#: src/config/dialogs.c:71 -msgid "Cannot access the file" -msgstr "Échec d'accès au fichier" - -#: src/config/dialogs.c:74 -msgid "Cannot create temp file" -msgstr "Échec de création de fichier temporaire" - -#: src/config/dialogs.c:77 -msgid "Cannot rename the file" -msgstr "Échec du renommage du fichier" - -#: src/config/dialogs.c:80 -msgid "File saving disabled by option" -msgstr "Sauvegarde de fichier désactivée par option" - -#: src/config/dialogs.c:86 -msgid "Cannot write the file" -msgstr "Ecriture du fichier impossible" - -#: src/config/dialogs.c:91 -msgid "Secure file saving error" -msgstr "Erreur de sauvegarde fiable du fichier" - -#: src/config/dialogs.c:99 +#: src/config/dialogs.c:69 msgid "Write config error" msgstr "Erreur d'écriture de configuration" -#: src/config/dialogs.c:100 +#: src/config/dialogs.c:70 #, c-format msgid "" "Unable to write to config file %s.\n" @@ -1844,25 +1817,25 @@ msgstr "" "Impossible d'écrire dans le fichier de configuration %s.\n" "%s" -#: src/config/dialogs.c:155 +#: src/config/dialogs.c:125 msgid "modified" msgstr "modifié" -#: src/config/dialogs.c:174 +#: src/config/dialogs.c:145 msgid "(expand by pressing space)" msgstr "(déployer en pressant espace)" -#: src/config/dialogs.c:177 src/config/dialogs.c:360 -#: src/config/options.inc:872 +#: src/config/dialogs.c:149 src/config/dialogs.c:330 +#: src/config/options.inc:819 msgid "Type" msgstr "Type" -#: src/config/dialogs.c:202 src/config/dialogs.c:389 src/cookies/dialogs.c:35 -#: src/cookies/dialogs.c:351 +#: src/config/dialogs.c:174 src/config/dialogs.c:361 src/cookies/dialogs.c:35 +#: src/cookies/dialogs.c:367 msgid "Value" msgstr "Valeur" -#: src/config/dialogs.c:206 +#: src/config/dialogs.c:178 msgid "" "\n" "\n" @@ -1872,30 +1845,30 @@ msgstr "" "\n" "Cette valeur a changé depuis que vous avez sauvé votre configuration." -#: src/config/dialogs.c:212 src/config/dialogs.c:364 +#: src/config/dialogs.c:184 src/config/dialogs.c:335 msgid "N/A" msgstr "N/A" -#: src/config/dialogs.c:214 src/config/dialogs.c:362 +#: src/config/dialogs.c:186 src/config/dialogs.c:333 msgid "Description" msgstr "Description" -#: src/config/dialogs.c:321 src/protocol/bittorrent/dialogs.c:599 -#: src/protocol/protocol.c:230 src/session/session.c:290 -#: src/session/session.c:975 src/viewer/text/textarea.c:571 -#: src/viewer/text/textarea.c:578 +#: src/config/dialogs.c:291 src/protocol/bittorrent/dialogs.c:599 +#: src/protocol/protocol.c:230 src/session/session.c:285 +#: src/session/session.c:970 src/viewer/text/textarea.c:590 +#: src/viewer/text/textarea.c:597 msgid "Error" msgstr "Erreur" -#: src/config/dialogs.c:322 +#: src/config/dialogs.c:292 msgid "Bad option value." msgstr "Mauvaise valeur." -#: src/config/dialogs.c:350 src/config/dialogs.c:418 src/cookies/dialogs.c:323 +#: src/config/dialogs.c:320 src/config/dialogs.c:390 src/cookies/dialogs.c:337 msgid "Edit" msgstr "Modifier" -#: src/config/dialogs.c:419 +#: src/config/dialogs.c:391 msgid "" "This option cannot be edited. This means that this is some special option " "like a folder - try to press a space in order to see its contents." @@ -1904,7 +1877,7 @@ msgstr "" "Il s'agit d'une option spéciale (comme un dossier),\n" "essayez de presser la touche ESPACE pour voir son contenu." -#: src/config/dialogs.c:461 +#: src/config/dialogs.c:433 msgid "" "Option names may only contain alpha-numeric characters\n" "in addition to '_' and '-'." @@ -1912,42 +1885,42 @@ msgstr "" "Les noms d'options ne doivent contenir que des caractères\n" "alphanumériques ou les caractères '_' et '-'." -#: src/config/dialogs.c:482 src/config/dialogs.c:507 +#: src/config/dialogs.c:454 src/config/dialogs.c:479 msgid "Add option" msgstr "Ajouter option" -#: src/config/dialogs.c:483 +#: src/config/dialogs.c:455 msgid "Cannot add an option here." msgstr "Impossible d'ajouter une option ici." #. accelerator_context(src/config/dialogs.c:keybinding_buttons, src/config/dialogs.c:option_buttons, src/cookies/dialogs.c:cookie_buttons, src/formhist/dialogs.c:formhist_buttons, src/protocol/bittorrent/dialogs.c:bittorrent_query_callback, src/session/download.c:do_type_query, terminal_options) -#: src/config/dialogs.c:535 src/config/dialogs.c:963 src/cookies/dialogs.c:479 -#: src/dialogs/options.c:236 src/formhist/dialogs.c:214 -#: src/protocol/bittorrent/dialogs.c:799 src/session/download.c:1227 +#: src/config/dialogs.c:507 src/config/dialogs.c:935 src/cookies/dialogs.c:495 +#: src/dialogs/options.c:234 src/formhist/dialogs.c:214 +#: src/protocol/bittorrent/dialogs.c:799 src/session/download.c:1250 msgid "Sa~ve" msgstr "Enre~gistrer" -#: src/config/dialogs.c:540 +#: src/config/dialogs.c:512 msgid "Option manager" msgstr "Gestionnaire d'options" -#: src/config/dialogs.c:702 +#: src/config/dialogs.c:674 msgid "Keystroke" msgstr "Touches" -#: src/config/dialogs.c:704 src/config/options.inc:1234 +#: src/config/dialogs.c:676 src/config/options.inc:1198 msgid "Action" msgstr "Action" -#: src/config/dialogs.c:705 +#: src/config/dialogs.c:677 msgid "Keymap" msgstr "Table" -#: src/config/dialogs.c:844 +#: src/config/dialogs.c:816 msgid "Keystroke already used" msgstr "Touche déjà utilisée" -#: src/config/dialogs.c:845 +#: src/config/dialogs.c:817 #, c-format msgid "" "The keystroke \"%s\" is currently used for \"%s\".\n" @@ -1956,19 +1929,19 @@ msgstr "" "La combinaison de touches \"%s\" est déjà utilisée pour l'action \"%s\".\n" "Etes-vous sûr de vouloir la remplacer ?" -#: src/config/dialogs.c:870 src/config/dialogs.c:887 src/config/dialogs.c:923 +#: src/config/dialogs.c:842 src/config/dialogs.c:859 src/config/dialogs.c:895 msgid "Add keybinding" msgstr "Ajouter une association de touches" -#: src/config/dialogs.c:871 +#: src/config/dialogs.c:843 msgid "Invalid keystroke." msgstr "Touche invalide." -#: src/config/dialogs.c:888 +#: src/config/dialogs.c:860 msgid "Need to select an action." msgstr "Vous devez sélectionner une action." -#: src/config/dialogs.c:910 +#: src/config/dialogs.c:882 #, c-format msgid "" "Action: %s\n" @@ -1989,15 +1962,15 @@ msgstr "" "Combinaison de touches" #. accelerator_context(menu_keys, src/config/dialogs.c:keybinding_buttons, src/globhist/dialogs.c:globhist_buttons) -#: src/config/dialogs.c:961 src/dialogs/info.c:135 src/globhist/dialogs.c:231 +#: src/config/dialogs.c:933 src/dialogs/info.c:135 src/globhist/dialogs.c:231 msgid "~Toggle display" msgstr "Co~mmuter affich." -#: src/config/dialogs.c:968 +#: src/config/dialogs.c:940 msgid "Keybinding manager" msgstr "Gestionnaire d'assoc. de touches" -#: src/config/home.c:121 +#: src/config/home.c:122 #, c-format msgid "" "Commandline options -config-dir set to %s, but could not create directory %s." @@ -2005,12 +1978,13 @@ msgstr "" "L'option de ligne de commande -config-dir vaut %s, mais le répertoire %s ne " "peut être créé." -#: src/config/home.c:126 +#: src/config/home.c:127 #, c-format msgid "ELINKS_CONFDIR set to %s, but could not create directory %s." msgstr "ELINKS_CONFDIR vaut %s, mais le répertoire %s ne peut être créé." -#: src/config/home.c:149 +#: src/config/home.c:150 +#, c-format msgid "" "Unable to find or create ELinks config directory. Please check if you have " "$HOME variable set correctly and if you have write permission to your home " @@ -2204,7 +2178,7 @@ msgstr "" "Nombre d'essais pour établir une connexion.\n" "Zéro signifie essais infinis." -#: src/config/options.inc:93 src/network/state.c:52 +#: src/config/options.inc:93 src/network/state.c:53 msgid "Receive timeout" msgstr "Délai d'expiration pour la réception" @@ -2566,13 +2540,13 @@ msgstr "Couleurs" msgid "Active link colors." msgstr "Couleurs du lien actif." -#: src/config/options.inc:274 src/config/options.inc:548 -#: src/config/options.inc:960 +#: src/config/options.inc:274 src/config/options.inc:549 +#: src/config/options.inc:924 msgid "Background color" msgstr "Couleur du fond" -#: src/config/options.inc:276 src/config/options.inc:550 -#: src/config/options.inc:961 +#: src/config/options.inc:276 src/config/options.inc:551 +#: src/config/options.inc:925 msgid "Default background color." msgstr "Couleur par défaut du fond." @@ -2584,13 +2558,13 @@ msgstr "Couleur par d #. * on it. #. The colors and mono tree should be similar but with different default #. * values of course so always use the macros below. -#: src/config/options.inc:278 src/config/options.inc:544 -#: src/config/options.inc:958 +#: src/config/options.inc:278 src/config/options.inc:545 +#: src/config/options.inc:922 msgid "Text color" msgstr "Couleur du texte" -#: src/config/options.inc:280 src/config/options.inc:546 -#: src/config/options.inc:959 +#: src/config/options.inc:280 src/config/options.inc:547 +#: src/config/options.inc:923 msgid "Default text color." msgstr "Couleur du texte par défaut." @@ -2624,8 +2598,8 @@ msgid "Invert the fore- and background color so the link stands out." msgstr "" "Inverser les couleurs de fond et de texte pour mettre le lien en évidence." -#: src/config/options.inc:296 src/config/options.inc:923 -#: src/dialogs/options.c:231 +#: src/config/options.inc:296 src/config/options.inc:887 +#: src/dialogs/options.c:229 msgid "Underline" msgstr "Souligné" @@ -3054,43 +3028,47 @@ msgstr "Intervalle de revalidation" #: src/config/options.inc:508 msgid "" -"Period that a cache entry is considered to be up-to-date.\n" -"When a document is loaded and this interval has elapsed since the\n" -"document was initially loaded or most recently revalidated\n" -"with the server, the server will be checked in case there is\n" -"a more up-to-date version of the document." +"Period in seconds that a cache entry is considered to be\n" +"up-to-date. When a document is loaded and this interval has elapsed\n" +"since the document was initially loaded or most recently\n" +"revalidated with the server, the server will be checked in case\n" +"there is a more up-to-date version of the document.\n" +"\n" +"A value of -1 disables automatic revalidation." msgstr "" -"Période pendant laquelle une entrée du cache est considérée valide.\n" -"Quand un document est chargé et que le temps écoulé depuis son\n" -"premier chargement ou sa dernière revalidation avec le serveur,\n" -"une vérification auprès du serveur de l'existence d'une version\n" -"plus récente aura lieu." +"Période en secondes pendant laquelle une entrée du cache est\n" +"considérée valide. Quand un document est chargé et que le temps\n" +"écoulé depuis son premier chargement ou sa dernière revalidation\n" +"avec le serveur, une vérification auprès du serveur de l'existence\n" +"d'une version plus récente du document aura lieu.\n" +"\n" +"Une valeur de -1 désactive la revalidation automatique." -#: src/config/options.inc:514 src/dialogs/info.c:201 +#: src/config/options.inc:515 src/dialogs/info.c:201 msgid "Memory cache" msgstr "Cache mémoire" -#: src/config/options.inc:516 +#: src/config/options.inc:517 msgid "Memory cache options." msgstr "Options du cache mémoire." -#: src/config/options.inc:520 +#: src/config/options.inc:521 msgid "Memory cache size (in bytes)." msgstr "Taille du cache mémoire (en octets)." -#: src/config/options.inc:524 +#: src/config/options.inc:525 msgid "Charset" msgstr "Jeu de caractères" -#: src/config/options.inc:526 +#: src/config/options.inc:527 msgid "Charset options." msgstr "Options des jeux de caractères." -#: src/config/options.inc:528 +#: src/config/options.inc:529 msgid "Default codepage" msgstr "Page de caractères par défaut" -#: src/config/options.inc:530 +#: src/config/options.inc:531 msgid "" "Default document codepage. 'System' stands for\n" "a codepage determined by a selected locale." @@ -3099,59 +3077,59 @@ msgstr "" "'Système' indique que celui-ci sera déterminé par\n" "la locale en cours." -#: src/config/options.inc:533 +#: src/config/options.inc:534 msgid "Ignore charset info from server" msgstr "Ignorer le jeu de caractères indiqué par le serveur" -#: src/config/options.inc:535 +#: src/config/options.inc:536 msgid "Ignore charset info sent by server." msgstr "Ignorer le jeu de caractères indiqué par le serveur." -#: src/config/options.inc:539 +#: src/config/options.inc:540 msgid "Default color settings" msgstr "Configuration des couleurs par défaut" -#: src/config/options.inc:541 +#: src/config/options.inc:542 msgid "Default document color settings." msgstr "Configuration des couleurs par défaut." -#: src/config/options.inc:552 +#: src/config/options.inc:553 msgid "Link color" msgstr "Couleur des liens" -#: src/config/options.inc:554 +#: src/config/options.inc:555 msgid "Default link color." msgstr "Couleur des liens par défaut." -#: src/config/options.inc:556 +#: src/config/options.inc:557 msgid "Visited-link color" msgstr "Couleur des liens visités" -#: src/config/options.inc:558 +#: src/config/options.inc:559 msgid "Default visited link color." msgstr "Couleur des liens visités par défaut." -#: src/config/options.inc:560 +#: src/config/options.inc:561 msgid "Image-link color" msgstr "Couleur des liens images" -#: src/config/options.inc:562 +#: src/config/options.inc:563 msgid "Default image link color." msgstr "Couleur par défaut des liens images." -#: src/config/options.inc:564 +#: src/config/options.inc:565 msgid "Bookmarked-link color" msgstr "Couleur des liens signets" -#: src/config/options.inc:566 +#: src/config/options.inc:567 msgid "Default bookmarked link color." msgstr "Couleur par défaut des liens signets." -#: src/config/options.inc:568 +#: src/config/options.inc:569 msgid "Directory color" msgstr "Couleur des répertoires" -#: src/config/options.inc:570 +#: src/config/options.inc:571 msgid "" "Default directory color.\n" "See document.browse.links.color_dirs option." @@ -3159,11 +3137,11 @@ msgstr "" "Couleur des répertoires par défaut.\n" "Voir l'option document.browse.links.color_dirs." -#: src/config/options.inc:577 +#: src/config/options.inc:578 msgid "Increase contrast" msgstr "Augmenter le contraste" -#: src/config/options.inc:579 +#: src/config/options.inc:580 msgid "" "Increase the contrast between the foreground and background colors\n" "to ensure readability. For example it disallows dark colors on a\n" @@ -3175,21 +3153,21 @@ msgstr "" "sombres sur un fond noir. Notez que cela est différent de l'action\n" "de l'option ensure_contrast." -#: src/config/options.inc:584 +#: src/config/options.inc:585 msgid "Ensure contrast" msgstr "Garantir le contraste" -#: src/config/options.inc:586 +#: src/config/options.inc:587 msgid "Makes sure that the back- and foreground color are never equal." msgstr "Forcer l'utilisation de couleurs différentes pour le fond et le texte." #. If you change this please also change ACT_MAIN_DOCUMENT_COLORS action #. * handling. -#: src/config/options.inc:591 +#: src/config/options.inc:592 msgid "Use document-specified colors" msgstr "Utiliser les couleurs spécifiées par le document" -#: src/config/options.inc:593 +#: src/config/options.inc:594 msgid "" "Use colors specified in document:\n" "0 is use always the default settings\n" @@ -3209,27 +3187,27 @@ msgstr "" " fonctionnera pas correctement." #. Keep options in alphabetical order. -#: src/config/options.inc:606 +#: src/config/options.inc:607 msgid "Downloading" msgstr "Téléchargement" -#: src/config/options.inc:608 +#: src/config/options.inc:609 msgid "Options regarding files downloading and handling." msgstr "Options de téléchargement." -#: src/config/options.inc:610 +#: src/config/options.inc:611 msgid "Default download directory" msgstr "Répertoire de téléchargement par défaut" -#: src/config/options.inc:612 +#: src/config/options.inc:613 msgid "Default download directory." msgstr "Répertoire de téléchargement par défaut." -#: src/config/options.inc:614 +#: src/config/options.inc:615 msgid "Set original time" msgstr "Configurer la date de fichier" -#: src/config/options.inc:616 +#: src/config/options.inc:617 msgid "" "Set the timestamp of each downloaded file to the timestamp\n" "stored on the server." @@ -3238,11 +3216,11 @@ msgstr "" "téléchargé." #. Does automatic resuming make sense as an option? -#: src/config/options.inc:620 +#: src/config/options.inc:621 msgid "Prevent overwriting" msgstr "Prévenir l'écrasement" -#: src/config/options.inc:622 +#: src/config/options.inc:623 msgid "" "Prevent overwriting the local files:\n" "0 is files will silently be overwritten\n" @@ -3254,11 +3232,11 @@ msgstr "" "1 ajouter un suffixe .{nombre} (par exemple '.1') au nom\n" "2 demander à l'utilisateur" -#: src/config/options.inc:627 +#: src/config/options.inc:628 msgid "Notify download completion by bell" msgstr "Notifier la fin du téléchargement par une sonnerie" -#: src/config/options.inc:629 +#: src/config/options.inc:630 msgid "" "Audio notification when download is completed:\n" "0 is never\n" @@ -3270,20 +3248,20 @@ msgstr "" "1 quand la notification de fin de tâche de fond est active\n" "2 toujours" -#: src/config/options.inc:635 +#: src/config/options.inc:636 msgid "Dump output" msgstr "Sortie (dump)" -#: src/config/options.inc:637 +#: src/config/options.inc:638 msgid "Dump output options." msgstr "Options de sortie (dump)." -#: src/config/options.inc:639 src/config/options.inc:927 +#: src/config/options.inc:640 src/config/options.inc:891 #: src/config/opttypes.c:408 src/dialogs/document.c:163 msgid "Codepage" msgstr "Jeu de caractères" -#: src/config/options.inc:641 +#: src/config/options.inc:642 msgid "" "Codepage used in dump output. 'System' stands for\n" "a codepage determined by a selected locale." @@ -3292,73 +3270,22 @@ msgstr "" "'System' indique que celui-ci sera déterminé par la locale\n" "en cours." -#: src/config/options.inc:650 src/config/options.inc:659 -#: src/config/options.inc:667 src/config/options.inc:675 -#: src/config/options.inc:682 src/config/options.inc:692 -#: src/config/options.inc:701 src/config/options.inc:710 -#: src/config/options.inc:904 +#: src/config/options.inc:645 src/config/options.inc:857 msgid "Color mode" msgstr "Mode couleurs" +#. The list of modes must be at the end of this string +#. * because AsciiDoc 7.1.2 does not support continuing +#. * an outer list entry after an inner list. +#. * TRANSLATORS: This restriction applies only to the +#. * "en" (English) translation. (See doc/Makefile.) #: src/config/options.inc:652 msgid "" -"Color mode for dumps:\n" -"-1 is standard dump mode\n" -"0 is mono mode\n" -"1 is 16 color mode\n" -"2 is 88 color mode\n" -"3 is 256 color mode" -msgstr "" -"Mode couleurs pour la sortie (option -dump):\n" -"-1 pas de couleurs (normal)\n" -"0 mode monochrome\n" -"1 mode 16 couleurs\n" -"2 mode 88 couleurs\n" -"3 mode 256 couleurs" - -#: src/config/options.inc:661 -msgid "" -"Color mode for dumps:\n" -"-1 is standard dump mode\n" -"0 is mono mode\n" -"1 is 16 color mode\n" -"2 is 88 color mode" -msgstr "" -"Mode couleurs pour la sortie (option -dump):\n" -"-1 pas de couleurs (normal)\n" -"0 mode monochrome\n" -"1 mode 16 couleurs\n" -"2 mode 88 couleurs" - -#: src/config/options.inc:669 -msgid "" -"Color mode for dumps:\n" -"-1 is standard dump mode\n" -"0 is mono mode\n" -"1 is 16 color mode\n" -"2 is 256 color mode" -msgstr "" -"Mode couleurs pour la sortie (option -dump):\n" -"-1 pas de couleurs (normal)\n" -"0 mode monochrome\n" -"1 mode 16 couleurs\n" -"2 mode 256 couleurs" - -#: src/config/options.inc:677 -msgid "" -"Color mode for dumps:\n" -"-1 is standard dump mode\n" -"0 is mono mode\n" -"1 is 16 color mode" -msgstr "" -"Mode couleurs pour la sortie (option -dump):\n" -"-1 pas de couleurs (normal)\n" -"0 mode monochrome\n" -"1 mode 16 couleurs" - -#: src/config/options.inc:684 -msgid "" -"Color mode for dumps:\n" +"Color mode for dumps.\n" +"Some modes may have been disabled at compile time. The Setup -> Terminal " +"options dialog lists the modes supported by this executable. If you select " +"an unsupported mode, ELinks uses 16 colors.\n" +"The color modes are:\n" "-1 is standard dump mode\n" "0 is mono mode\n" "1 is 16 color mode\n" @@ -3366,173 +3293,133 @@ msgid "" "3 is 256 color mode\n" "4 is true color mode" msgstr "" -"Mode couleurs pour la sortie (option -dump):\n" -"-1 pas de couleurs (normal)\n" -"0 mode monochrome\n" -"1 mode 16 couleurs\n" -"2 mode 88 couleurs\n" -"3 mode 256 couleurs\n" -"4 mode vraies couleurs" +"Mode couleurs pour la sortie standard.\n" +"Certains de ces modes ont pu être désactivés au moment de la\n" +"compilation. Le dialogue Configuration -> Options du terminal\n" +"liste les modes supportés par cet exécutable.\n" +"Si vous sélectionnez un mode non supporté, ELinks utilisera\n" +"le mode 16 couleurs.\n" +"Les modes sont:\n" +"-1 est le mode standard\n" +" 0 est le mode monochrome\n" +" 1 est le mode 16 couleurs\n" +" 2 est le mode 88 couleurs\n" +" 3 est le mode 256 couleurs\n" +" 4 est le mode vraies couleurs" -#: src/config/options.inc:694 -msgid "" -"Color mode for dumps:\n" -"-1 is standard dump mode\n" -"0 is mono mode\n" -"1 is 16 color mode\n" -"2 is 88 color mode\n" -"3 is true color mode" -msgstr "" -"Mode couleurs pour la sortie (option -dump):\n" -"-1 pas de couleurs (normal)\n" -"0 mode monochrome\n" -"1 mode 16 couleurs\n" -"2 mode 88 couleurs\n" -"3 mode vraies couleurs" - -#: src/config/options.inc:703 -msgid "" -"Color mode for dumps:\n" -"-1 is standard dump mode\n" -"0 is mono mode\n" -"1 is 16 color mode\n" -"2 is 256 color mode\n" -"3 is true color mode" -msgstr "" -"Mode couleurs pour la sortie (option -dump):\n" -"-1 pas de couleurs (normal)\n" -"0 mode monochrome\n" -"1 mode 16 couleurs\n" -"2 mode 256 couleurs\n" -"3 mode vraies couleurs" - -#: src/config/options.inc:712 -msgid "" -"Color mode for dumps:\n" -"-1 is standard dump mode\n" -"0 is mono mode\n" -"1 is 16 color mode\n" -"2 is true color mode" -msgstr "" -"Mode couleurs pour la sortie (option -dump):\n" -"-1 pas de couleurs (normal)\n" -"0 mode monochrome\n" -"1 mode 16 couleurs\n" -"2 mode vraies couleurs" - -#: src/config/options.inc:718 +#: src/config/options.inc:665 msgid "Footer" msgstr "Pied de page" -#: src/config/options.inc:720 +#: src/config/options.inc:667 #, c-format msgid "Footer string used in dumps. %u is substituted by URL." msgstr "" "Chaîne de pied de page utilisée lors des dumps.\n" "%u est remplacé par l'URL du document." -#: src/config/options.inc:724 +#: src/config/options.inc:671 #, c-format msgid "Header string used in dumps. %u is substituted by URL." msgstr "" "Chaîne d'en-tête utilisée lors des dumps.\n" "%u est remplacé par l'URL du document." -#: src/config/options.inc:726 +#: src/config/options.inc:673 msgid "Numbering" msgstr "Numérotation" -#: src/config/options.inc:728 +#: src/config/options.inc:675 msgid "Whether to print link numbers in dump output." msgstr "Numéroter ou non les liens en sortie (dump)." -#: src/config/options.inc:730 +#: src/config/options.inc:677 msgid "References" msgstr "Références" -#: src/config/options.inc:732 +#: src/config/options.inc:679 msgid "" "Whether to print references (URIs) of document links\n" "in dump output." msgstr "Afficher ou non les références (URIs) des liens en sortie (dump)." -#: src/config/options.inc:735 +#: src/config/options.inc:682 msgid "Separator" msgstr "Séparateur" -#: src/config/options.inc:737 +#: src/config/options.inc:684 msgid "String which separates two dumps." msgstr "Chaîne qui sépare deux dumps." -#: src/config/options.inc:739 +#: src/config/options.inc:686 msgid "Width" msgstr "Largeur" -#: src/config/options.inc:741 +#: src/config/options.inc:688 msgid "Width of screen in characters when dumping documents." msgstr "Largeur de l'écran en caractères pour les dumps." -#: src/config/options.inc:745 +#: src/config/options.inc:692 msgid "History" msgstr "Historique" -#: src/config/options.inc:747 +#: src/config/options.inc:694 msgid "History options." msgstr "Options de l'historique." -#: src/config/options.inc:749 +#: src/config/options.inc:696 msgid "Keep unhistory" msgstr "Historique inverse" -#: src/config/options.inc:751 +#: src/config/options.inc:698 msgid "Keep unhistory (\"forward history\")." msgstr "Historique inverse (\"forward history\")." -#: src/config/options.inc:754 +#: src/config/options.inc:701 msgid "HTML rendering" msgstr "Rendu HTML" -#: src/config/options.inc:756 +#: src/config/options.inc:703 msgid "Options concerning the display of HTML pages." msgstr "Options d'affichage des pages HTML." -#: src/config/options.inc:758 +#: src/config/options.inc:705 msgid "Display frames" msgstr "Afficher les cadres" -#: src/config/options.inc:760 +#: src/config/options.inc:707 msgid "Display frames." msgstr "Afficher les cadres." -#: src/config/options.inc:762 +#: src/config/options.inc:709 msgid "Display tables" msgstr "Afficher les tableaux" -#: src/config/options.inc:764 +#: src/config/options.inc:711 msgid "Display tables." msgstr "Afficher les tableaux." -#: src/config/options.inc:766 +#: src/config/options.inc:713 msgid "Display subscripts" msgstr "Afficher subscripts" -#: src/config/options.inc:768 +#: src/config/options.inc:715 msgid "Display subscripts (as [thing])." msgstr "Afficher subscripts (comme [chose])." -#: src/config/options.inc:770 +#: src/config/options.inc:717 msgid "Display superscripts" msgstr "Afficher superscripts" -#: src/config/options.inc:772 +#: src/config/options.inc:719 msgid "Display superscripts (as ^thing)." msgstr "Afficher superscripts (comme ^chose)." -#: src/config/options.inc:774 +#: src/config/options.inc:721 msgid "Rendering of html link element" msgstr "Rendu des éléments html link" -#: src/config/options.inc:776 +#: src/config/options.inc:723 msgid "" "How to render tags from the HTML header:\n" "0 is nothing\n" @@ -3550,19 +3437,19 @@ msgstr "" "4 type de contenu en plus\n" "5 tout" -#: src/config/options.inc:784 +#: src/config/options.inc:731 msgid "Underline links" msgstr "Souligner les liens" -#: src/config/options.inc:786 +#: src/config/options.inc:733 msgid "Underline links." msgstr "Souligner les liens." -#: src/config/options.inc:788 +#: src/config/options.inc:735 msgid "Wrap non breaking space" msgstr "Césure sur les espaces non sécables (nbsp)" -#: src/config/options.inc:790 +#: src/config/options.inc:737 msgid "" "If set do not honour non breaking space (the nbsp entity)\n" "but allow to wrap the text. This can help keeping the width\n" @@ -3572,35 +3459,35 @@ msgstr "" "(entité nbsp). Cela peut aider à garder la largeur des documents\n" "à une valeur basse, limitant ainsi le besoin de déroulement horizontal." -#: src/config/options.inc:795 +#: src/config/options.inc:742 msgid "Plain rendering" msgstr "Rendu plein texte" -#: src/config/options.inc:797 +#: src/config/options.inc:744 msgid "Options concerning the display of plain text pages." msgstr "Options d'affichage des pages plein texte." -#: src/config/options.inc:799 +#: src/config/options.inc:746 msgid "Display URIs" msgstr "Afficher les URIs" -#: src/config/options.inc:801 +#: src/config/options.inc:748 msgid "Display URIs in the document as links." msgstr "Afficher les URIs dans le document en tant que liens." -#: src/config/options.inc:803 +#: src/config/options.inc:750 msgid "Compress empty lines" msgstr "Compresser les lignes vides" -#: src/config/options.inc:805 +#: src/config/options.inc:752 msgid "Compress successive empty lines to only one in displayed text." msgstr "Compresser les lignes vides successives en une dans le texte affiché." -#: src/config/options.inc:808 +#: src/config/options.inc:755 msgid "URI passing" msgstr "Passage d'URI" -#: src/config/options.inc:810 +#: src/config/options.inc:757 msgid "" "Rules for passing URIs to external commands. When one rule\n" "is defined the link and tab menu will have a menu item that\n" @@ -3625,7 +3512,7 @@ msgstr "" "frame-external-command, link-external-command, et\n" "tab-external-command." -#: src/config/options.inc:823 +#: src/config/options.inc:770 msgid "" "A rule for passing URI to an external command.\n" "The format is:\n" @@ -3640,19 +3527,19 @@ msgstr "" "Ne mettez pas de simples ou doubles guillemets autour de %c." #. Keep options in alphabetical order. -#: src/config/options.inc:833 +#: src/config/options.inc:780 msgid "Information files" msgstr "Fichiers d'information" -#: src/config/options.inc:835 +#: src/config/options.inc:782 msgid "Options for information files in ~/.elinks." msgstr "Options concernant les fichiers d'information dans ~/.elinks." -#: src/config/options.inc:837 +#: src/config/options.inc:784 msgid "Save interval" msgstr "Intervalle pour la sauvegarde automatique" -#: src/config/options.inc:839 +#: src/config/options.inc:786 msgid "" "Interval at which to trigger information files in ~/.elinks\n" "to be saved to disk if they has changed (seconds; 0 to disable)" @@ -3660,11 +3547,11 @@ msgstr "" "Intervalle pour la sauvegarde des fichiers d'information dans ~/.elinks\n" "lorsque ceux-ci ont été modifiés (en secondes; 0 pour désactiver)" -#: src/config/options.inc:842 +#: src/config/options.inc:789 msgid "Use secure file saving" msgstr "Fiabiliser la sauvegarde des fichiers" -#: src/config/options.inc:844 +#: src/config/options.inc:791 msgid "" "First write data to unique temporary file, then rename this file\n" "upon successfully finishing this. Note that this relates only to\n" @@ -3687,11 +3574,11 @@ msgstr "" "destination n'existe pas au moment de l'appel à rename(3), cela casse\n" "l'atomicité de l'opération et réduit la fiabilité de cette fonctionnalité." -#: src/config/options.inc:853 +#: src/config/options.inc:800 msgid "Use fsync(3) with secure file saving" msgstr "Utiliser fsync(3) avec la sauvegarde fiable des fichiers" -#: src/config/options.inc:855 +#: src/config/options.inc:802 msgid "" "When using secure file saving, call fsync(3), if the OS\n" "supports it, to force the OS immediately to write the data\n" @@ -3705,21 +3592,21 @@ msgstr "" "éviter une utilisation excessive des entrées/sorties disque." #. Keep options in alphabetical order. -#: src/config/options.inc:864 +#: src/config/options.inc:811 msgid "Terminals" msgstr "Terminaux" -#: src/config/options.inc:866 +#: src/config/options.inc:813 msgid "Terminal options." msgstr "Options du terminal." -#: src/config/options.inc:870 +#: src/config/options.inc:817 msgid "Options specific to this terminal type (according to $TERM value)." msgstr "" "Options spécifiques à ce type de terminal (conformément à la valeur de " "$TERM)." -#: src/config/options.inc:874 +#: src/config/options.inc:821 msgid "" "Terminal type; matters mostly only when drawing frames and\n" "dialog box borders:\n" @@ -3736,11 +3623,11 @@ msgstr "" "3 KOI-8\n" "4 FreeBSD" -#: src/config/options.inc:882 src/dialogs/options.c:227 +#: src/config/options.inc:829 src/dialogs/options.c:225 msgid "Switch fonts for line drawing" msgstr "Echanger les fontes pour dessiner les lignes" -#: src/config/options.inc:884 +#: src/config/options.inc:831 msgid "" "Switch fonts when drawing lines, enabling both local characters\n" "and lines working at the same time. Makes sense only with linux\n" @@ -3749,25 +3636,31 @@ msgstr "" "Echanger les fontes de caractères pour le dessin des lignes, seulement\n" "intéressant avec le terminal de type linux." -#: src/config/options.inc:888 src/dialogs/options.c:232 +#. When CONFIG_UTF8 is defined, any code that reads the "utf_8_io" +#. * option should also check whether the "codepage" option is UTF-8, +#. * and if so, behave as if "utf_8_io" were 1. (When CONFIG_UTF8 is +#. * not defined, it should not be possible to set UTF-8 as "codepage"; +#. * please report any such possibilities as bugs.) +#: src/config/options.inc:840 src/dialogs/options.c:230 msgid "UTF-8 I/O" msgstr "E/S UTF-8" -#: src/config/options.inc:890 +#: src/config/options.inc:842 msgid "" -"Enable I/O in UTF8 for Unicode terminals. Note that currently,\n" -"only the subset of UTF8 according to terminal codepage is used." +"Enable I/O in UTF-8 for Unicode terminals. Note that currently,\n" +"only the subset of UTF-8 according to terminal codepage is used.\n" +"ELinks ignores this option if the terminal codepage is UTF-8." msgstr "" -"Activer les E/S en UTF8 pour les terminaux Unicode. Notez que, pour " -"l'instant,\n" -"seule une partie de l'UTF8 est utilisée, en accord avec le jeu de caractères " -"du terminal." +"Activer les E/S en UTF8 pour les terminaux Unicode. Notez que,\n" +"pour l'instant, seule une partie de l'UTF8 est utilisée, en accord\n" +"avec l'encodage de caractères du terminal. ELinks ignore cette\n" +"option si l'encodage de caractères utilisé par le terminal est UTF-8." -#: src/config/options.inc:893 src/dialogs/options.c:228 +#: src/config/options.inc:846 src/dialogs/options.c:226 msgid "Restrict frames in cp850/852" msgstr "Limiter les cadres dans cp850/852" -#: src/config/options.inc:895 +#: src/config/options.inc:848 msgid "" "Restrict the characters used when drawing lines. Makes sense\n" "only with linux terminals using the cp850/852 character sets." @@ -3776,11 +3669,11 @@ msgstr "" "N'a du sens que pour les terminaux linux utilisant les jeux de\n" "caractères cp850/852." -#: src/config/options.inc:898 src/dialogs/options.c:229 +#: src/config/options.inc:851 src/dialogs/options.c:227 msgid "Block cursor" msgstr "Bloquer le curseur" -#: src/config/options.inc:900 +#: src/config/options.inc:853 msgid "" "Move cursor to bottom right corner when done drawing.\n" "This is particularly useful when we have a block cursor,\n" @@ -3791,27 +3684,43 @@ msgstr "" "en forme de bloc est utilisé, ainsi le texte inversé\n" "est affiché correctement." -#: src/config/options.inc:906 +#. The list of modes must be at the end of this string +#. * because AsciiDoc 7.1.2 does not support continuing +#. * an outer list entry after an inner list. +#. * TRANSLATORS: This restriction applies only to the +#. * "en" (English) translation. (See doc/Makefile.) +#: src/config/options.inc:864 msgid "" -"The color mode controls what colors are used and how they are\n" -"output to the terminal. The color modes are:\n" +"The color mode controls what colors are used and how they are output to the " +"terminal.\n" +"Some modes may have been disabled at compile time. The Setup -> Terminal " +"options dialog lists the modes supported by this executable. If you select " +"an unsupported mode, ELinks uses 16 colors.\n" +"The color modes are:\n" "0 is mono mode, only 2 colors are used\n" "1 is 16 color mode, uses the common ANSI colors\n" -"2 is 256 color mode, uses XTerm RGB codes\n" -"3 is true color mode, uses konsole RGB codes." +"2 is 88 color mode, uses XTerm RGB codes\n" +"3 is 256 color mode, uses XTerm RGB codes\n" +"4 is true color mode, uses konsole RGB codes" msgstr "" "Le mode couleurs définit le nombre de couleurs affichées.\n" +"Certains de ces modes ont pu être désactivés au moment de la\n" +"compilation. Le dialogue Configuration -> Options du terminal\n" +"lists les modes supportés par cet exécutable.\n" +"Si vous sélectionnez un mode non supporté, ELinks utilisera\n" +"le mode 16 couleurs.\n" "Les choix possibles sont:\n" -"0 mode monochrome, 2 couleurs seulement sont utilisées\n" -"1 mode 16 couleurs, les couleurs ANSI sont utilisées\n" -"2 mode 256 couleurs, utilise les codes RGB d'XTerm\n" -"3 mode vraies couleurs, utilise les codes RGB de konsole." +"0 mode monochrome, utilise seulement 2 couleurs\n" +"1 mode 16 couleurs, utilise les couleurs ANSI\n" +"2 mode 88 couleurs, utilise les codes RVB d'XTerm\n" +"3 mode 256 couleurs, utilise les codes RVB d'XTerm\n" +"4 mode vraies couleurs, utilise les codes RVB de konsole" -#: src/config/options.inc:913 src/dialogs/options.c:230 +#: src/config/options.inc:877 src/dialogs/options.c:228 msgid "Transparency" msgstr "Transparence" -#: src/config/options.inc:915 +#: src/config/options.inc:879 msgid "" "If we should not set the background to black. This is particularly\n" "useful when we have a terminal (typically in some windowing\n" @@ -3829,11 +3738,11 @@ msgstr "" "un fond clair vous rencontrerez des problèmes de contraste).\n" "Cette option n'a de sens que quand les couleurs sont activées." -#: src/config/options.inc:925 +#: src/config/options.inc:889 msgid "If we should use underline or enhance the color instead." msgstr "Si nous devons utiliser le souligné ou modifier la couleur." -#: src/config/options.inc:929 +#: src/config/options.inc:893 msgid "" "Codepage of charset used for displaying content on terminal.\n" "'System' stands for a codepage determined by a selected locale." @@ -3843,374 +3752,374 @@ msgstr "" "sélectionnée." #. Keep options in alphabetical order. -#: src/config/options.inc:936 +#: src/config/options.inc:900 msgid "User interface" msgstr "Interface utilisateur" -#: src/config/options.inc:938 +#: src/config/options.inc:902 msgid "User interface options." msgstr "Options de l'interface utilisateur." -#: src/config/options.inc:942 +#: src/config/options.inc:906 msgid "Color settings" msgstr "Configuration des couleurs" -#: src/config/options.inc:944 +#: src/config/options.inc:908 msgid "Default user interface color settings." msgstr "Configuration des couleurs de l'interface utilisateur." -#: src/config/options.inc:971 +#: src/config/options.inc:935 msgid "Color terminals" msgstr "Terminaux couleur" -#: src/config/options.inc:973 +#: src/config/options.inc:937 msgid "Color settings for color terminal." msgstr "Configuration des couleurs des terminaux couleur." -#: src/config/options.inc:975 +#: src/config/options.inc:939 msgid "Non-color terminals" msgstr "Terminaux monochromes" -#: src/config/options.inc:977 +#: src/config/options.inc:941 msgid "Color settings for non-color terminal." msgstr "Configuration des couleurs pour les terminaux monochromes." #. FIXME: obsolete, how to alias them correctly ? --Zas -#: src/config/options.inc:980 +#: src/config/options.inc:944 msgid "Main menu bar" msgstr "Barre du menu principal" -#: src/config/options.inc:982 +#: src/config/options.inc:946 msgid "Main menu bar colors." msgstr "Couleurs de la barre du menu principal." -#: src/config/options.inc:984 +#: src/config/options.inc:948 msgid "Unselected main menu bar item" msgstr "Item non sélectionné de la barre de menu" -#: src/config/options.inc:986 +#: src/config/options.inc:950 msgid "Unselected main menu bar item colors." msgstr "Couleurs des items non sélectionnés de la barre de menu." -#: src/config/options.inc:988 +#: src/config/options.inc:952 msgid "Selected main menu bar item" msgstr "Item sélectionné de la barre de menu" -#: src/config/options.inc:990 +#: src/config/options.inc:954 msgid "Selected main menu bar item colors." msgstr "Couleurs de l'item sélectionné de la barre de menu." -#: src/config/options.inc:992 src/config/options.inc:1021 +#: src/config/options.inc:956 src/config/options.inc:985 msgid "Hotkey" msgstr "Raccourci clavier" -#: src/config/options.inc:994 +#: src/config/options.inc:958 msgid "Main menu hotkey colors." msgstr "Couleurs des raccourcis de la barre du menu principal." -#: src/config/options.inc:996 src/config/options.inc:1025 +#: src/config/options.inc:960 src/config/options.inc:989 msgid "Unselected hotkey" msgstr "Raccourci non sélectionné" -#: src/config/options.inc:998 +#: src/config/options.inc:962 msgid "Main menu unselected hotkey colors." msgstr "Couleurs des raccourcis non sélectionnés du menu principal." -#: src/config/options.inc:1000 src/config/options.inc:1029 +#: src/config/options.inc:964 src/config/options.inc:993 msgid "Selected hotkey" msgstr "Raccourci sélectionné" -#: src/config/options.inc:1002 +#: src/config/options.inc:966 msgid "Main menu selected hotkey colors." msgstr "Couleurs des raccourcis sélectionnés du menu principal." -#: src/config/options.inc:1005 +#: src/config/options.inc:969 msgid "Menu bar" msgstr "Barre de menu" -#: src/config/options.inc:1007 +#: src/config/options.inc:971 msgid "Menu bar colors." msgstr "Couleurs de la barre de menu." -#: src/config/options.inc:1009 +#: src/config/options.inc:973 msgid "Unselected menu item" msgstr "Item non sélectionné du menu" -#: src/config/options.inc:1011 +#: src/config/options.inc:975 msgid "Unselected menu item colors." msgstr "Couleurs des items non sélectionnés du menu." -#: src/config/options.inc:1013 +#: src/config/options.inc:977 msgid "Selected menu item" msgstr "Item sélectionné du menu" -#: src/config/options.inc:1015 +#: src/config/options.inc:979 msgid "Selected menu item colors." msgstr "Couleurs de l'item sélectionnés du menu." -#: src/config/options.inc:1017 +#: src/config/options.inc:981 msgid "Marked menu item" msgstr "Item de menu marqué" -#: src/config/options.inc:1019 +#: src/config/options.inc:983 msgid "Marked menu item colors." msgstr "Couleurs de l'item du menu marqué." -#: src/config/options.inc:1023 +#: src/config/options.inc:987 msgid "Menu item hotkey colors." msgstr "Couleurs des raccourcis dans les menus." -#: src/config/options.inc:1027 +#: src/config/options.inc:991 msgid "Menu item unselected hotkey colors." msgstr "Couleurs des raccourcis non sélectionnés dans les menus." -#: src/config/options.inc:1031 +#: src/config/options.inc:995 msgid "Menu item selected hotkey colors." msgstr "Couleurs des raccourcis sélectionnés dans les menus." -#: src/config/options.inc:1033 +#: src/config/options.inc:997 msgid "Menu frame" msgstr "Bordure du menu" -#: src/config/options.inc:1035 +#: src/config/options.inc:999 msgid "Menu frame colors." msgstr "Couleurs de la bordure du menu." -#: src/config/options.inc:1038 +#: src/config/options.inc:1002 msgid "Dialog" msgstr "Dialogue" -#: src/config/options.inc:1040 +#: src/config/options.inc:1004 msgid "Dialog colors." msgstr "Couleurs des dialogues." -#: src/config/options.inc:1050 +#: src/config/options.inc:1014 msgid "Generic" msgstr "Générique" -#: src/config/options.inc:1052 +#: src/config/options.inc:1016 msgid "Generic dialog colors." msgstr "Couleurs des dialogues génériques." -#: src/config/options.inc:1054 +#: src/config/options.inc:1018 msgid "Frame" msgstr "Bordure" -#: src/config/options.inc:1056 +#: src/config/options.inc:1020 msgid "Dialog frame colors." msgstr "Couleurs de la bordure des dialogues." -#: src/config/options.inc:1058 +#: src/config/options.inc:1022 msgid "Scrollbar" msgstr "Barre de défilement" -#: src/config/options.inc:1060 +#: src/config/options.inc:1024 msgid "Scrollbar colors." msgstr "Couleurs de la barre de défilement." -#: src/config/options.inc:1062 +#: src/config/options.inc:1026 msgid "Selected scrollbar" msgstr "Barre de défilement sélectionnée" -#: src/config/options.inc:1064 +#: src/config/options.inc:1028 msgid "Scrollbar selected colors." msgstr "Couleurs de la barre de défilement sélectionnée." -#: src/config/options.inc:1068 +#: src/config/options.inc:1032 msgid "Dialog title colors." msgstr "Couleurs du titre des dialogues." -#: src/config/options.inc:1070 +#: src/config/options.inc:1034 msgid "Text" msgstr "Texte" -#: src/config/options.inc:1072 +#: src/config/options.inc:1036 msgid "Dialog text colors." msgstr "Couleurs du texte des dialogues." -#: src/config/options.inc:1074 src/viewer/text/form.c:1801 +#: src/config/options.inc:1038 src/viewer/text/form.c:1802 msgid "Checkbox" msgstr "Case à cocher" -#: src/config/options.inc:1076 +#: src/config/options.inc:1040 msgid "Dialog checkbox colors." msgstr "Couleurs des cases à cocher dans les dialogues." -#: src/config/options.inc:1078 +#: src/config/options.inc:1042 msgid "Selected checkbox" msgstr "Case à cocher sélectionnée" -#: src/config/options.inc:1080 +#: src/config/options.inc:1044 msgid "Dialog selected checkbox colors." msgstr "Couleurs de la case à cocher sélectionnée dans les dialogues." -#: src/config/options.inc:1082 +#: src/config/options.inc:1046 msgid "Checkbox label" msgstr "Label de case à cocher" -#: src/config/options.inc:1084 +#: src/config/options.inc:1048 msgid "Dialog checkbox label colors." msgstr "Couleurs des labels des cases à cocher dans les dialogues." -#: src/config/options.inc:1086 +#: src/config/options.inc:1050 msgid "Button" msgstr "Bouton" -#: src/config/options.inc:1088 src/config/options.inc:1096 +#: src/config/options.inc:1052 src/config/options.inc:1060 msgid "Dialog button colors." msgstr "Couleurs des boutons des dialogues." -#: src/config/options.inc:1090 +#: src/config/options.inc:1054 msgid "Selected button" msgstr "Bouton sélectionné" -#: src/config/options.inc:1092 src/config/options.inc:1100 +#: src/config/options.inc:1056 src/config/options.inc:1064 msgid "Dialog selected button colors." msgstr "Couleurs du bouton sélectionné dans les dialogues." -#: src/config/options.inc:1094 +#: src/config/options.inc:1058 msgid "Button shortcut" msgstr "Raccourci du bouton" -#: src/config/options.inc:1098 +#: src/config/options.inc:1062 msgid "Selected button shortcut" msgstr "Raccourci du bouton sélectionné" -#: src/config/options.inc:1102 src/viewer/text/form.c:1805 +#: src/config/options.inc:1066 src/viewer/text/form.c:1806 msgid "Text field" msgstr "Champ texte" -#: src/config/options.inc:1104 +#: src/config/options.inc:1068 msgid "Dialog text field colors." msgstr "Couleurs des champs texte dans les dialogues." -#: src/config/options.inc:1106 +#: src/config/options.inc:1070 msgid "Text field text" msgstr "Texte des champs texte" -#: src/config/options.inc:1108 +#: src/config/options.inc:1072 msgid "Dialog field text colors." msgstr "Couleurs de texte des champs texte dans les dialogues." -#: src/config/options.inc:1110 +#: src/config/options.inc:1074 msgid "Meter" msgstr "Barre de progression" -#: src/config/options.inc:1112 +#: src/config/options.inc:1076 msgid "Dialog meter colors." msgstr "Couleurs des barres de progression." -#: src/config/options.inc:1114 +#: src/config/options.inc:1078 msgid "Shadow" msgstr "Ombrage" -#: src/config/options.inc:1116 +#: src/config/options.inc:1080 msgid "Dialog shadow colors (see ui.shadows option)." msgstr "Couleurs des ombres des dialogues (voir l'option ui.shadows)." -#: src/config/options.inc:1118 +#: src/config/options.inc:1082 msgid "Title bar" msgstr "Barre de titre" -#: src/config/options.inc:1120 +#: src/config/options.inc:1084 msgid "Title bar colors." msgstr "Couleurs de la barre de titre." -#: src/config/options.inc:1122 +#: src/config/options.inc:1086 msgid "Generic title bar" msgstr "Barre de titre générique" -#: src/config/options.inc:1124 +#: src/config/options.inc:1088 msgid "Generic title bar colors." msgstr "Couleurs de la barre de titre générique." -#: src/config/options.inc:1126 +#: src/config/options.inc:1090 msgid "Title bar text" msgstr "Texte de la barre de titre" -#: src/config/options.inc:1128 +#: src/config/options.inc:1092 msgid "Title bar text colors." msgstr "Couleurs du texte de la barre de titre." -#: src/config/options.inc:1131 +#: src/config/options.inc:1095 msgid "Status bar" msgstr "Barre d'état" -#: src/config/options.inc:1133 +#: src/config/options.inc:1097 msgid "Status bar colors." msgstr "Couleurs de la barre d'état." -#: src/config/options.inc:1135 +#: src/config/options.inc:1099 msgid "Generic status bar" msgstr "Barre d'état générique" -#: src/config/options.inc:1137 +#: src/config/options.inc:1101 msgid "Generic status bar colors." msgstr "Couleurs de la barre d'état générique." -#: src/config/options.inc:1139 +#: src/config/options.inc:1103 msgid "Status bar text" msgstr "Texte de la barre d'état" -#: src/config/options.inc:1141 +#: src/config/options.inc:1105 msgid "Status bar text colors." msgstr "Couleurs du texte de la barre d'état." -#: src/config/options.inc:1144 +#: src/config/options.inc:1108 msgid "Tabs bar" msgstr "Barre d'onglets" -#: src/config/options.inc:1146 +#: src/config/options.inc:1110 msgid "Tabs bar colors." msgstr "Couleurs de la barre d'onglets." -#: src/config/options.inc:1148 +#: src/config/options.inc:1112 msgid "Unvisited tab" msgstr "Onglet non visité" -#: src/config/options.inc:1150 +#: src/config/options.inc:1114 msgid "" "Tab colors for tabs that have not been\n" "selected since they completed loading." msgstr "Couleurs pour les onglets non encore visités depuis leur chargement." -#: src/config/options.inc:1153 +#: src/config/options.inc:1117 msgid "Unselected tab" msgstr "Onglet non sélectionné" -#: src/config/options.inc:1155 +#: src/config/options.inc:1119 msgid "Unselected tab colors." msgstr "Couleurs des onglets non sélectionnés." -#: src/config/options.inc:1157 +#: src/config/options.inc:1121 msgid "Loading tab" msgstr "Onglet en cours de chargement" -#: src/config/options.inc:1159 +#: src/config/options.inc:1123 msgid "Tab colors for tabs that are loading in the background." msgstr "Couleurs pour les onglets en cours de chargement." -#: src/config/options.inc:1161 +#: src/config/options.inc:1125 msgid "Selected tab" msgstr "Onglet sélectionné" -#: src/config/options.inc:1163 +#: src/config/options.inc:1127 msgid "Selected tab colors." msgstr "Couleurs de l'onglet sélectionné." -#: src/config/options.inc:1165 +#: src/config/options.inc:1129 msgid "Tab separator" msgstr "Séparateur d'onglets" -#: src/config/options.inc:1167 +#: src/config/options.inc:1131 msgid "Tab separator colors." msgstr "Couleurs du séparateur d'onglets." -#: src/config/options.inc:1170 +#: src/config/options.inc:1134 msgid "Searched strings" msgstr "Chaînes recherchées" -#: src/config/options.inc:1172 +#: src/config/options.inc:1136 msgid "Searched string highlight colors." msgstr "Couleurs de mise en évidence des chaînes recherchées." @@ -4218,19 +4127,19 @@ msgstr "Couleurs de mise en #. ============= BORING PART (colors) END =================== #. ========================================================== #. Keep options in alphabetical order. -#: src/config/options.inc:1181 +#: src/config/options.inc:1145 msgid "Dialog settings" msgstr "Configuration des dialogues" -#: src/config/options.inc:1183 +#: src/config/options.inc:1147 msgid "Dialogs-specific appearance and behaviour settings." msgstr "Configuration de l'apparence et du fonctionnement des dialogues." -#: src/config/options.inc:1186 +#: src/config/options.inc:1150 msgid "Minimal height of listbox widget" msgstr "Hauteur minimale des boîtes liste" -#: src/config/options.inc:1188 +#: src/config/options.inc:1152 msgid "" "Minimal height of the listbox widget (used e.g. for bookmarks\n" "or global history)." @@ -4238,11 +4147,11 @@ msgstr "" "Hauteur minimale des boîtes liste (utilisée par exemple pour les\n" "signets ou l'historique global)." -#: src/config/options.inc:1191 +#: src/config/options.inc:1155 msgid "Drop shadows" msgstr "Porter des ombres" -#: src/config/options.inc:1193 +#: src/config/options.inc:1157 msgid "" "Make dialogs drop shadows (the shadows are solid, you can\n" "adjust their color by ui.colors.*.dialog.shadow). You may\n" @@ -4252,11 +4161,11 @@ msgstr "" "ombres est définie par ui.colors.*.dialog.shadow). Vous pouvez\n" "réduire la largeur des bordures en éditant setup.h." -#: src/config/options.inc:1197 +#: src/config/options.inc:1161 msgid "Underline menu hotkeys" msgstr "Souligner les raccourcis des menus" -#: src/config/options.inc:1199 +#: src/config/options.inc:1163 msgid "" "Whether to underline hotkeys in menus to make them more\n" "visible. Requires the underlining is enabled for the terminal." @@ -4264,11 +4173,11 @@ msgstr "" "Souligner ou non les raccourcis des menus pour les rendre\n" "plus visibles. Le soulignement doit être activé pour le terminal." -#: src/config/options.inc:1202 +#: src/config/options.inc:1166 msgid "Underline button shortcuts" msgstr "Souligner les raccourcis des boutons" -#: src/config/options.inc:1204 +#: src/config/options.inc:1168 msgid "" "Whether to underline button shortcuts to make them more\n" "visible. Requires the underlining is enabled for the terminal." @@ -4276,11 +4185,11 @@ msgstr "" "Souligner ou non les raccourcis des boutons pour les rendre\n" "plus visibles. Le soulignement doit être activé pour le terminal." -#: src/config/options.inc:1208 +#: src/config/options.inc:1172 msgid "Timer options" msgstr "Options des timers" -#: src/config/options.inc:1210 +#: src/config/options.inc:1174 msgid "" "Timed action after certain interval of user inactivity. Someone can\n" "even find this useful, although you may not believe that." @@ -4288,7 +4197,7 @@ msgstr "" "Action après un certain temps d'inactivité de l'utilisateur. Certains\n" "peuvent trouver ceci utile ou non." -#: src/config/options.inc:1216 +#: src/config/options.inc:1180 msgid "" "Whether to enable the timer or not:\n" "0 is don't count down anything\n" @@ -4300,7 +4209,7 @@ msgstr "" "1 oui, mais ne pas montrer le timer\n" "2 oui et montrer le timer près des LEDs" -#: src/config/options.inc:1223 +#: src/config/options.inc:1187 msgid "" "Whether to enable the timer or not:\n" "0 is don't count down anything\n" @@ -4312,11 +4221,11 @@ msgstr "" "1 oui, mais ne pas montrer le timer\n" "2 oui et montrer le timer près des LEDs (DÉSACTIVÉ)" -#: src/config/options.inc:1229 +#: src/config/options.inc:1193 msgid "Duration" msgstr "Durée" -#: src/config/options.inc:1231 +#: src/config/options.inc:1195 msgid "" "Inactivity timeout in seconds. The maximum of one day\n" "should be enough for just everyone (TM)." @@ -4324,23 +4233,23 @@ msgstr "" "Délai d'inactivité en secondes. Une durée maximale\n" "d'un jour devrait suffire à tout le monde (TM)." -#: src/config/options.inc:1236 +#: src/config/options.inc:1200 msgid "Keybinding action to be triggered when timer reaches zero." msgstr "Action à déclencher lorsque le timer atteint zéro." -#: src/config/options.inc:1239 +#: src/config/options.inc:1203 msgid "Window tabs" msgstr "Onglets" -#: src/config/options.inc:1241 +#: src/config/options.inc:1205 msgid "Window tabs settings." msgstr "Configuration des onglets." -#: src/config/options.inc:1243 +#: src/config/options.inc:1207 msgid "Display tabs bar" msgstr "Afficher la barre d'onglets" -#: src/config/options.inc:1245 +#: src/config/options.inc:1209 msgid "" "Show tabs bar on the screen:\n" "0 means never\n" @@ -4352,20 +4261,20 @@ msgstr "" "1 seulement si deux onglets ou plus sont ouverts\n" "2 toujours" -#: src/config/options.inc:1250 +#: src/config/options.inc:1214 msgid "Tab bar at top" msgstr "Barre d'onglets en haut" -#: src/config/options.inc:1252 +#: src/config/options.inc:1216 msgid "Whether display tab bar at top like other browsers do." msgstr "" "Afficher ou non la barre d'onglets en haut, comme les autres navigateurs." -#: src/config/options.inc:1254 +#: src/config/options.inc:1218 msgid "Wrap-around tabs cycling" msgstr "Navigation cyclique dans les onglets" -#: src/config/options.inc:1256 +#: src/config/options.inc:1220 msgid "" "When moving right from the last tab, jump at the first one, and\n" "vice versa." @@ -4373,20 +4282,20 @@ msgstr "" "En cas de déplacement à droite sur le dernier onglet, saute au premier\n" "et vice-versa." -#: src/config/options.inc:1259 +#: src/config/options.inc:1223 msgid "Confirm tab closing" msgstr "Confirmer la fermeture d'onglet" -#: src/config/options.inc:1261 +#: src/config/options.inc:1225 msgid "When closing a tab show confirmation dialog." msgstr "" "Lors de la fermeture d'un onglet, afficher un dialogue de confirmation." -#: src/config/options.inc:1265 src/config/opttypes.c:409 +#: src/config/options.inc:1229 src/config/opttypes.c:409 msgid "Language" msgstr "Langue" -#: src/config/options.inc:1267 +#: src/config/options.inc:1231 msgid "" "Language of user interface. 'System' means that the language will\n" "be extracted from the environment dynamically." @@ -4394,35 +4303,35 @@ msgstr "" "Langue de l'interface utilisateur. 'System' signifie que la langue\n" "sera dynamiquement extraite de l'environnement." -#: src/config/options.inc:1270 +#: src/config/options.inc:1234 msgid "Display menu bar always" msgstr "Toujours afficher la barre de menu" -#: src/config/options.inc:1272 +#: src/config/options.inc:1236 msgid "Always show menu bar on the screen." msgstr "Toujours montrer la barre de menu à l'écran." -#: src/config/options.inc:1274 +#: src/config/options.inc:1238 msgid "Display status bar" msgstr "Afficher la barre d'état" -#: src/config/options.inc:1276 +#: src/config/options.inc:1240 msgid "Show status bar on the screen." msgstr "Montrer la barre d'état." -#: src/config/options.inc:1278 +#: src/config/options.inc:1242 msgid "Display title bar" msgstr "Afficher la barre de titre" -#: src/config/options.inc:1280 +#: src/config/options.inc:1244 msgid "Show title bar on the screen." msgstr "Montrer la barre de titre." -#: src/config/options.inc:1282 +#: src/config/options.inc:1246 msgid "Display goto dialog in new tabs" msgstr "Afficher le dialogue \"Atteindre l'URL\" dans les nouveaux onglets" -#: src/config/options.inc:1284 +#: src/config/options.inc:1248 msgid "" "Pop up goto dialog in newly created tabs when there's no homepage\n" "set. This means also showing goto dialog on startup." @@ -4431,11 +4340,11 @@ msgstr "" "quand aucune page d'accueil n'est configurée. Cela implique aussi de\n" "montrer le dialogue au démarrage." -#: src/config/options.inc:1287 +#: src/config/options.inc:1251 msgid "Show a message box when file is saved successfully" msgstr "Afficher un dialogue quand le fichier a été sauvé avec succès" -#: src/config/options.inc:1289 +#: src/config/options.inc:1253 msgid "" "When you pressed a [ Save ] button in some manager, this option\n" "will make sure that a box confirming success of the operation will\n" @@ -4445,27 +4354,27 @@ msgstr "" "option active un dialogue qui confirme que l'opération s'est déroulée\n" "correctement." -#: src/config/options.inc:1294 +#: src/config/options.inc:1258 msgid "Sessions" msgstr "Sessions" -#: src/config/options.inc:1296 +#: src/config/options.inc:1260 msgid "Sessions settings." msgstr "Configuration des sessions." -#: src/config/options.inc:1298 +#: src/config/options.inc:1262 msgid "Keep session active" msgstr "Garder la session active" -#: src/config/options.inc:1300 +#: src/config/options.inc:1264 msgid "Keep the session active even if the last terminal exits." msgstr "Garder la session active même si le dernier terminal est clos." -#: src/config/options.inc:1302 +#: src/config/options.inc:1266 msgid "Auto save session" msgstr "Sauver automatiquement la session" -#: src/config/options.inc:1304 +#: src/config/options.inc:1268 msgid "" "Automatically save the session when quitting.\n" "This feature requires bookmark support." @@ -4473,11 +4382,11 @@ msgstr "" "Sauvegarder automatiquement la session au moment de quitter.\n" "Cette fonctionnalité nécessite le support des signets." -#: src/config/options.inc:1307 +#: src/config/options.inc:1271 msgid "Auto restore session" msgstr "Restaurer automatiquement la session" -#: src/config/options.inc:1309 +#: src/config/options.inc:1273 msgid "" "Automatically restore the session at start.\n" "This feature requires bookmark support." @@ -4485,11 +4394,11 @@ msgstr "" "Restaurer automatiquement la session au démarrage.\n" "Cette fonctionnalité nécessite le support des signets." -#: src/config/options.inc:1312 +#: src/config/options.inc:1276 msgid "Auto save and restore session folder name" msgstr "Nom du dossier pour la session automatique" -#: src/config/options.inc:1314 +#: src/config/options.inc:1278 msgid "" "Name of the bookmarks folder used for auto saving and restoring session.\n" "The name has to be unique. Any folders with the same name will be deleted.\n" @@ -4499,11 +4408,11 @@ msgstr "" "automatique de la session. Le nom doit être unique, tout dossier du même\n" "nom sera détruit. Cette option n'a de sens qu'avec le support des signets." -#: src/config/options.inc:1318 +#: src/config/options.inc:1282 msgid "Homepage URI" msgstr "URI de la page d'accueil" -#: src/config/options.inc:1320 +#: src/config/options.inc:1284 msgid "" "The URI to load either at startup time when no URI was given\n" "on the command line or when requested by the goto-url-home action.\n" @@ -4515,19 +4424,19 @@ msgstr "" "Mettre \"\" si la variable d'environnement WWW_HOME doit être\n" "utilisée comme URI de page d'accueil." -#: src/config/options.inc:1326 +#: src/config/options.inc:1290 msgid "Date format" msgstr "Format des dates" -#: src/config/options.inc:1328 +#: src/config/options.inc:1292 msgid "Date format to use in dialogs. See strftime(3)." msgstr "Format utilisé pour les dates dans les dialogues. Voir strftime(3)." -#: src/config/options.inc:1331 +#: src/config/options.inc:1295 msgid "Set window title" msgstr "Modifier le titre de la fenêtre" -#: src/config/options.inc:1333 +#: src/config/options.inc:1297 msgid "" "Set the window title when running in a windowing environment\n" "in an xterm-like terminal. This way the document's title is\n" @@ -4609,19 +4518,19 @@ msgid "Goto URL History" msgstr "Historique Aller à" #. name: -#: src/cookies/cookies.c:80 src/cookies/cookies.c:858 +#: src/cookies/cookies.c:89 src/cookies/cookies.c:938 msgid "Cookies" msgstr "Cookies" -#: src/cookies/cookies.c:82 +#: src/cookies/cookies.c:91 msgid "Cookies options." msgstr "Options des cookies." -#: src/cookies/cookies.c:84 +#: src/cookies/cookies.c:93 msgid "Accept policy" msgstr "Politique d'acceptation" -#: src/cookies/cookies.c:87 +#: src/cookies/cookies.c:96 msgid "" "Cookies accepting policy:\n" "0 is accept no cookies\n" @@ -4633,11 +4542,11 @@ msgstr "" "1 demander confirmation avant d'accepter un cookie\n" "2 accepter tous les cookies" -#: src/cookies/cookies.c:92 +#: src/cookies/cookies.c:101 msgid "Maximum age" msgstr "Age maximal" -#: src/cookies/cookies.c:94 +#: src/cookies/cookies.c:103 msgid "" "Cookie maximum age (in days):\n" "-1 is use cookie's expiration date if any\n" @@ -4653,11 +4562,11 @@ msgstr "" " 1+ utiliser si possible la date d'expiration du cookie,\n" " mais limiter l'age à ce nombre de jours" -#: src/cookies/cookies.c:101 +#: src/cookies/cookies.c:110 msgid "Paranoid security" msgstr "Sécurité maximale (parano.)" -#: src/cookies/cookies.c:103 +#: src/cookies/cookies.c:112 msgid "" "When enabled, we'll require three dots in cookies domain for all\n" "non-international domains (instead of just two dots). Some countries\n" @@ -4673,19 +4582,19 @@ msgstr "" "potentiellement être très mauvais. Notez, cette option est désactivée\n" "par défaut car elle empêche le bon fonctionnement de nombreux sites." -#: src/cookies/cookies.c:109 +#: src/cookies/cookies.c:118 msgid "Saving" msgstr "Sauvegarde" -#: src/cookies/cookies.c:111 +#: src/cookies/cookies.c:120 msgid "Whether cookies should be loaded from and save to disk." msgstr "Charger/sauvegarder ou non les cookies sur disque." -#: src/cookies/cookies.c:113 +#: src/cookies/cookies.c:122 msgid "Resaving" msgstr "Sauvegarde répétée" -#: src/cookies/cookies.c:115 +#: src/cookies/cookies.c:124 msgid "" "Save cookies after each change in cookies list? No effect when\n" "cookie saving (cookies.save) is off." @@ -4693,7 +4602,19 @@ msgstr "" "Sauvegarde des cookies après chaque modification ?\n" "Aucun effet si la sauvegarde (cookies.save) est désactivée." -#: src/cookies/dialogs.c:36 src/cookies/dialogs.c:352 +#: src/cookies/cookies.c:844 +msgid "Cannot save cookies" +msgstr "Ne peut sauvegarder les cookies" + +#: src/cookies/cookies.c:855 +msgid "ELinks was started without a home directory." +msgstr "ELinks a été démarré sans répertoire personnel." + +#: src/cookies/cookies.c:861 +msgid "ELinks was started with the -anonymous option." +msgstr "ELinks a été démarré avec l'option -anonymous." + +#: src/cookies/dialogs.c:36 src/cookies/dialogs.c:368 msgid "Domain" msgstr "Domaine" @@ -4706,7 +4627,7 @@ msgstr "Chemin" msgid "at quit time" msgstr "au moment de quitter" -#: src/cookies/dialogs.c:49 src/cookies/dialogs.c:354 +#: src/cookies/dialogs.c:49 src/cookies/dialogs.c:370 msgid "Secure" msgstr "Sécurisé" @@ -4718,116 +4639,116 @@ msgstr "oui" msgid "no" msgstr "non" -#: src/cookies/dialogs.c:70 +#: src/cookies/dialogs.c:82 #, c-format msgid "Do you want to accept a cookie from %s?" msgstr "Voulez-vous accepter un cookie en provenance de %s ?" -#: src/cookies/dialogs.c:78 +#: src/cookies/dialogs.c:90 msgid "Accept cookie?" msgstr "Accepter le cookie ?" #. accelerator_context(accept_cookie_dialog) -#: src/cookies/dialogs.c:81 +#: src/cookies/dialogs.c:93 msgid "~Accept" msgstr "~Accepter" #. accelerator_context(accept_cookie_dialog) -#: src/cookies/dialogs.c:82 +#: src/cookies/dialogs.c:94 msgid "~Reject" msgstr "~Rejeter" -#: src/cookies/dialogs.c:149 src/cookies/dialogs.c:342 +#: src/cookies/dialogs.c:161 src/cookies/dialogs.c:357 #: src/dialogs/document.c:177 msgid "Server" msgstr "Serveur" #. cant_delete_item -#: src/cookies/dialogs.c:201 +#: src/cookies/dialogs.c:209 #, c-format msgid "Sorry, but cookie \"%s\" cannot be deleted." msgstr "Désolé, mais le cookie \"%s\" ne peut être supprimé." #. cant_delete_used_item -#: src/cookies/dialogs.c:203 +#: src/cookies/dialogs.c:211 #, c-format msgid "Sorry, but cookie \"%s\" is being used by something else." msgstr "Désolé, mais le cookie \"%s\" est actuellement utilisé ailleurs." #. cant_delete_folder -#: src/cookies/dialogs.c:205 +#: src/cookies/dialogs.c:213 #, c-format msgid "Sorry, but cookie domain \"%s\" cannot be deleted." msgstr "Désolé, mais le domaine du cookie \"%s\" ne peut être supprimé." #. cant_delete_used_folder -#: src/cookies/dialogs.c:207 +#: src/cookies/dialogs.c:215 #, c-format msgid "Sorry, but cookie domain \"%s\" is being used by something else." msgstr "" "Désolé, mais le domaine du cookie \"%s\" est actuellement utilisé ailleurs." #. delete_marked_items_title -#: src/cookies/dialogs.c:209 +#: src/cookies/dialogs.c:217 msgid "Delete marked cookies" msgstr "Supprimer les cookies marqués" #. delete_marked_items -#: src/cookies/dialogs.c:211 +#: src/cookies/dialogs.c:219 msgid "Delete marked cookies?" msgstr "Supprimer les cookies marqués ?" #. delete_folder_title -#: src/cookies/dialogs.c:213 +#: src/cookies/dialogs.c:221 msgid "Delete domain's cookies" msgstr "Supprimer les cookies du domaine" #. delete_folder -#: src/cookies/dialogs.c:215 +#: src/cookies/dialogs.c:223 #, c-format msgid "Delete all cookies from domain \"%s\"?" msgstr "Supprimer tous les cookies du domaine \"%s\" ?" #. delete_item_title -#: src/cookies/dialogs.c:217 +#: src/cookies/dialogs.c:225 msgid "Delete cookie" msgstr "Supprimer un cookie" -#: src/cookies/dialogs.c:219 +#: src/cookies/dialogs.c:227 #, c-format msgid "Delete this cookie?" msgstr "Supprimer ce cookie ?" #. clear_all_items_title -#: src/cookies/dialogs.c:221 +#: src/cookies/dialogs.c:229 msgid "Clear all cookies" msgstr "Effacer tous les cookies" #. clear_all_items_title -#: src/cookies/dialogs.c:223 +#: src/cookies/dialogs.c:231 msgid "Do you really want to remove all cookies?" msgstr "Êtes-vous sûr de vouloir effacer tous les cookies ?" -#: src/cookies/dialogs.c:448 +#: src/cookies/dialogs.c:464 msgid "Add server" msgstr "Ajouter un serveur" -#: src/cookies/dialogs.c:452 +#: src/cookies/dialogs.c:468 msgid "Server name" msgstr "Nom du serveur" #. accelerator_context(src/cookies/dialogs.c:cookie_buttons) -#: src/cookies/dialogs.c:475 +#: src/cookies/dialogs.c:491 msgid "Add ~server" msgstr "Ajouter un ser~veur" #. accelerator_context(do_edit_dialog, src/cookies/dialogs.c:cookie_buttons, src/dialogs/download.c:download_buttons, src/globhist/dialogs.c:globhist_buttons, src/protocol/auth/dialogs.c:auth_buttons) -#: src/cookies/dialogs.c:478 src/dialogs/download.c:498 src/dialogs/edit.c:99 +#: src/cookies/dialogs.c:494 src/dialogs/download.c:498 src/dialogs/edit.c:99 #: src/globhist/dialogs.c:232 src/protocol/auth/dialogs.c:264 msgid "C~lear" msgstr "~Effacer" -#: src/cookies/dialogs.c:484 +#: src/cookies/dialogs.c:500 msgid "Cookie manager" msgstr "Gestionnaire de cookies" @@ -4887,7 +4808,7 @@ msgstr "Info. en-t msgid "No header info." msgstr "Aucune information d'en-tête." -#: src/dialogs/download.c:243 src/dialogs/menu.c:593 +#: src/dialogs/download.c:243 src/dialogs/menu.c:597 #: src/protocol/bittorrent/dialogs.c:228 src/session/download.c:398 msgid "Download" msgstr "Téléchargement" @@ -5139,398 +5060,398 @@ msgstr[1] "%ld octets surconsomm msgid "Save URL" msgstr "Enregistrer l'URL" -#: src/dialogs/menu.c:96 src/dialogs/menu.c:537 +#: src/dialogs/menu.c:96 src/dialogs/menu.c:541 msgid "Enter URL" msgstr "Entrez l'URL" -#: src/dialogs/menu.c:121 +#: src/dialogs/menu.c:125 msgid "Exit ELinks" msgstr "Quitter ELinks" -#: src/dialogs/menu.c:123 +#: src/dialogs/menu.c:127 msgid "Do you really want to exit ELinks (and terminate all downloads)?" msgstr "Interrompre les téléchargements en cours et quitter ELinks ?" -#: src/dialogs/menu.c:125 +#: src/dialogs/menu.c:129 msgid "Do you really want to exit ELinks?" msgstr "Êtes-vous sûr de vouloir quitter ELinks ?" -#: src/dialogs/menu.c:161 +#: src/dialogs/menu.c:165 msgid "No history" msgstr "Historique vide" #. accelerator_context(src/dialogs/menu.c:file_menu, tab_menu) -#: src/dialogs/menu.c:233 src/dialogs/menu.c:309 +#: src/dialogs/menu.c:237 src/dialogs/menu.c:313 msgid "Go ~back" msgstr "Ret~our" #. accelerator_context(tab_menu) -#: src/dialogs/menu.c:234 +#: src/dialogs/menu.c:238 msgid "Go for~ward" msgstr "Aller en a~vant" #. accelerator_context(src/dialogs/menu.c:file_menu, tab_menu) -#: src/dialogs/menu.c:241 src/dialogs/menu.c:322 +#: src/dialogs/menu.c:245 src/dialogs/menu.c:326 msgid "Bookm~ark document" msgstr "~Signet pour ce document" #. accelerator_context(src/dialogs/menu.c:view_menu, tab_menu) -#: src/dialogs/menu.c:245 src/dialogs/menu.c:414 +#: src/dialogs/menu.c:249 src/dialogs/menu.c:418 msgid "Toggle ~html/plain" msgstr "~Bascule html/source" #. accelerator_context(tab_menu) -#: src/dialogs/menu.c:246 +#: src/dialogs/menu.c:250 msgid "~Reload" msgstr "Ra~fraîchir" #. accelerator_context(src/dialogs/menu.c:view_menu, tab_menu) -#: src/dialogs/menu.c:249 src/dialogs/menu.c:424 +#: src/dialogs/menu.c:253 src/dialogs/menu.c:428 msgid "Frame at ~full-screen" msgstr "Ca~dre en plein écran" #. accelerator_context(tab_menu) -#: src/dialogs/menu.c:251 +#: src/dialogs/menu.c:255 msgid "~Pass frame URI to external command" msgstr "~Passer l'URI du cadre à une commande externe" #. accelerator_context(src/dialogs/menu.c:view_menu, tab_menu) -#: src/dialogs/menu.c:259 src/dialogs/menu.c:426 +#: src/dialogs/menu.c:263 src/dialogs/menu.c:430 msgid "Nex~t tab" msgstr "Ongle~t suivant" #. accelerator_context(src/dialogs/menu.c:view_menu, tab_menu) -#: src/dialogs/menu.c:260 src/dialogs/menu.c:427 +#: src/dialogs/menu.c:264 src/dialogs/menu.c:431 msgid "Pre~v tab" msgstr "O~nglet précédent" #. accelerator_context(src/dialogs/menu.c:view_menu, tab_menu) -#: src/dialogs/menu.c:263 src/dialogs/menu.c:428 +#: src/dialogs/menu.c:267 src/dialogs/menu.c:432 msgid "~Close tab" msgstr "Fer~mer un onglet" #. accelerator_context(tab_menu) -#: src/dialogs/menu.c:266 +#: src/dialogs/menu.c:270 msgid "C~lose all tabs but the current" msgstr "Fermer les ~autres onglets" #. accelerator_context(tab_menu) -#: src/dialogs/menu.c:270 +#: src/dialogs/menu.c:274 msgid "B~ookmark all tabs" msgstr "Si~gnets pour tous les onglets" #. accelerator_context(tab_menu) -#: src/dialogs/menu.c:278 +#: src/dialogs/menu.c:282 msgid "Pass tab URI to e~xternal command" msgstr "Passer l'URI de l'onglet à une commande e~xterne" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:306 +#: src/dialogs/menu.c:310 msgid "Open new ~tab" msgstr "Ouvrir un nouvel ongle~t" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:307 +#: src/dialogs/menu.c:311 msgid "Open new tab in backgroun~d" msgstr "Ouvrir un nouvel onglet en arrière-~plan" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:308 +#: src/dialogs/menu.c:312 msgid "~Go to URL" msgstr "~Atteindre l'URL" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:310 +#: src/dialogs/menu.c:314 msgid "Go ~forward" msgstr "Aller en a~vant" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:311 +#: src/dialogs/menu.c:315 msgid "~History" msgstr "~Historique" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:312 +#: src/dialogs/menu.c:316 msgid "~Unhistory" msgstr "Historique inve~rse" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:318 +#: src/dialogs/menu.c:322 msgid "~Save as" msgstr "~Enregistrer sous" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:319 +#: src/dialogs/menu.c:323 msgid "Save UR~L as" msgstr "Enregistrer l'URL so~us" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:320 +#: src/dialogs/menu.c:324 msgid "Sa~ve formatted document" msgstr "Enregistrer le ~document formaté" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:329 +#: src/dialogs/menu.c:333 msgid "~Kill background connections" msgstr "Tuer les conne~xions en arrière-plan" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:330 +#: src/dialogs/menu.c:334 msgid "Flush all ~caches" msgstr "Effacer les ~caches" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:331 +#: src/dialogs/menu.c:335 msgid "Resource ~info" msgstr "~Infos sur les ressources" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:338 +#: src/dialogs/menu.c:342 msgid "E~xit" msgstr "~Quitter" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:365 +#: src/dialogs/menu.c:369 msgid "Open ~new window" msgstr "Ouvrir une ~nouvelle fenêtre" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:384 +#: src/dialogs/menu.c:388 msgid "~OS shell" msgstr "~Ligne de commandes" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:391 +#: src/dialogs/menu.c:395 msgid "Resize t~erminal" msgstr "Redi~mensionner le terminal" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:409 +#: src/dialogs/menu.c:413 msgid "Search ~backward" msgstr "Chercher en ~arrière" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:410 +#: src/dialogs/menu.c:414 msgid "Find ~next" msgstr "Chercher le ~suivant" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:411 +#: src/dialogs/menu.c:415 msgid "Find ~previous" msgstr "Chercher le ~précédent" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:412 +#: src/dialogs/menu.c:416 msgid "T~ypeahead search" msgstr "~Recherche par préfrappe" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:415 +#: src/dialogs/menu.c:419 msgid "Toggle i~mages" msgstr "Bascule ~images" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:416 +#: src/dialogs/menu.c:420 msgid "Toggle ~link numbering" msgstr "Bascule numérotation ~liens" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:417 +#: src/dialogs/menu.c:421 msgid "Toggle ~document colors" msgstr "Bascule c~ouleurs du document" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:418 +#: src/dialogs/menu.c:422 msgid "~Wrap text on/off" msgstr "Bascule césure te~xte" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:420 +#: src/dialogs/menu.c:424 msgid "Document ~info" msgstr "Infos sur le doc~ument" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:421 +#: src/dialogs/menu.c:425 msgid "H~eader info" msgstr "In~fo. en-têtes" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:422 +#: src/dialogs/menu.c:426 msgid "Rel~oad document" msgstr "Rec~harger le document" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:423 +#: src/dialogs/menu.c:427 msgid "~Rerender document" msgstr "R~edessiner le document" #. accelerator_context(src/dialogs/menu.c:help_menu) -#: src/dialogs/menu.c:435 +#: src/dialogs/menu.c:439 msgid "~ELinks homepage" msgstr "~Site web ELinks" #. accelerator_context(src/dialogs/menu.c:help_menu) -#: src/dialogs/menu.c:436 +#: src/dialogs/menu.c:440 msgid "~Documentation" msgstr "~Documentation" #. accelerator_context(src/dialogs/menu.c:help_menu) -#: src/dialogs/menu.c:437 +#: src/dialogs/menu.c:441 msgid "~Keys" msgstr "~Touches" #. accelerator_context(src/dialogs/menu.c:help_menu) -#: src/dialogs/menu.c:439 +#: src/dialogs/menu.c:443 msgid "LED ~indicators" msgstr "I~ndicateurs LED" #. accelerator_context(src/dialogs/menu.c:help_menu) -#: src/dialogs/menu.c:442 +#: src/dialogs/menu.c:446 msgid "~Bugs information" msgstr "~Bogues" #. accelerator_context(src/dialogs/menu.c:help_menu) -#: src/dialogs/menu.c:444 +#: src/dialogs/menu.c:448 msgid "ELinks ~GITWeb" msgstr "~ELinks GITWeb" #. accelerator_context(src/dialogs/menu.c:help_menu) -#: src/dialogs/menu.c:447 +#: src/dialogs/menu.c:451 msgid "~Copying" msgstr "~Licence" #. accelerator_context(src/dialogs/menu.c:help_menu) -#: src/dialogs/menu.c:448 +#: src/dialogs/menu.c:452 msgid "~About" msgstr "~Info" #. accelerator_context(src/dialogs/menu.c:ext_menu) -#: src/dialogs/menu.c:456 +#: src/dialogs/menu.c:460 msgid "~Modify" msgstr "~Modifier" #. accelerator_context(src/dialogs/menu.c:setup_menu) -#: src/dialogs/menu.c:464 src/dialogs/menu.c:478 +#: src/dialogs/menu.c:468 src/dialogs/menu.c:482 msgid "~Language" msgstr "~Langue" #. accelerator_context(src/dialogs/menu.c:setup_menu) -#: src/dialogs/menu.c:466 src/dialogs/menu.c:479 +#: src/dialogs/menu.c:470 src/dialogs/menu.c:483 msgid "C~haracter set" msgstr "~Jeu de caractères" #. accelerator_context(src/dialogs/menu.c:setup_menu) -#: src/dialogs/menu.c:467 src/dialogs/menu.c:480 +#: src/dialogs/menu.c:471 src/dialogs/menu.c:484 msgid "~Terminal options" msgstr "Options du ~terminal" #. accelerator_context(src/dialogs/menu.c:setup_menu) -#: src/dialogs/menu.c:468 +#: src/dialogs/menu.c:472 msgid "File ~extensions" msgstr "E~xtensions de fichiers" #. accelerator_context(src/dialogs/menu.c:setup_menu) -#: src/dialogs/menu.c:470 +#: src/dialogs/menu.c:474 msgid "~Options manager" msgstr "Gestionnaire d'~options" #. accelerator_context(src/dialogs/menu.c:setup_menu) -#: src/dialogs/menu.c:471 +#: src/dialogs/menu.c:475 msgid "~Keybinding manager" msgstr "~Gestionnaire d'assoc. de touches" #. accelerator_context(src/dialogs/menu.c:setup_menu) -#: src/dialogs/menu.c:472 +#: src/dialogs/menu.c:476 msgid "~Save options" msgstr "~Enregistrer les options" #. accelerator_context(src/dialogs/menu.c:tools_menu) -#: src/dialogs/menu.c:487 +#: src/dialogs/menu.c:491 msgid "Global ~history" msgstr "~Historique global" #. accelerator_context(src/dialogs/menu.c:tools_menu) -#: src/dialogs/menu.c:490 +#: src/dialogs/menu.c:494 msgid "~Bookmarks" msgstr "~Signets" #. accelerator_context(src/dialogs/menu.c:tools_menu) -#: src/dialogs/menu.c:492 +#: src/dialogs/menu.c:496 msgid "~Cache" msgstr "~Cache" #. accelerator_context(src/dialogs/menu.c:tools_menu) -#: src/dialogs/menu.c:493 +#: src/dialogs/menu.c:497 msgid "~Downloads" msgstr "~Téléchargements" #. accelerator_context(src/dialogs/menu.c:tools_menu) -#: src/dialogs/menu.c:495 +#: src/dialogs/menu.c:499 msgid "Coo~kies" msgstr "Coo~kies" #. accelerator_context(src/dialogs/menu.c:tools_menu) -#: src/dialogs/menu.c:498 +#: src/dialogs/menu.c:502 msgid "~Form history" msgstr "Historique formu~laires" #. accelerator_context(src/dialogs/menu.c:tools_menu) -#: src/dialogs/menu.c:500 +#: src/dialogs/menu.c:504 msgid "~Authentication" msgstr "~Authentification" #. accelerator_context(src/dialogs/menu.c:main_menu) -#: src/dialogs/menu.c:517 +#: src/dialogs/menu.c:521 msgid "~File" msgstr "~Fichier" #. accelerator_context(src/dialogs/menu.c:main_menu) -#: src/dialogs/menu.c:518 +#: src/dialogs/menu.c:522 msgid "~View" msgstr "~Affichage" #. accelerator_context(src/dialogs/menu.c:main_menu) -#: src/dialogs/menu.c:519 +#: src/dialogs/menu.c:523 msgid "~Link" msgstr "~Lien" #. accelerator_context(src/dialogs/menu.c:main_menu) -#: src/dialogs/menu.c:520 +#: src/dialogs/menu.c:524 msgid "~Tools" msgstr "~Outils" #. accelerator_context(src/dialogs/menu.c:main_menu) -#: src/dialogs/menu.c:521 +#: src/dialogs/menu.c:525 msgid "~Setup" msgstr "~Configuration" #. accelerator_context(src/dialogs/menu.c:main_menu) -#: src/dialogs/menu.c:522 +#: src/dialogs/menu.c:526 msgid "~Help" msgstr "A~ide" -#: src/dialogs/menu.c:537 +#: src/dialogs/menu.c:541 msgid "Go to URL" msgstr "Atteindre l'URL" -#: src/dialogs/menu.c:593 +#: src/dialogs/menu.c:597 msgid "Save to file" msgstr "Enregistrer dans le fichier" -#: src/dialogs/menu.c:928 +#: src/dialogs/menu.c:932 msgid "Empty directory" msgstr "Répertoire vide" -#: src/dialogs/menu.c:972 +#: src/dialogs/menu.c:976 msgid "Directories:" msgstr "Répertoires:" -#: src/dialogs/menu.c:985 +#: src/dialogs/menu.c:989 msgid "Files:" msgstr "Fichiers:" #. 2 '\n' + 1 '\0' -#: src/dialogs/options.c:173 +#: src/dialogs/options.c:171 #, c-format msgid "" "The environmental variable TERM is set to '%s'.\n" @@ -5547,67 +5468,67 @@ msgstr "" "valeur de TERM. Cela vous permet de configurer indépendemment\n" "chacun des terminaux où vous utilisez ELinks." -#: src/dialogs/options.c:199 +#: src/dialogs/options.c:197 msgid "Terminal options" msgstr "Options du terminal" -#: src/dialogs/options.c:208 +#: src/dialogs/options.c:206 msgid "Frame handling:" msgstr "Gestion des cadres:" -#: src/dialogs/options.c:209 +#: src/dialogs/options.c:207 msgid "No frames" msgstr "Aucun cadre" -#: src/dialogs/options.c:210 +#: src/dialogs/options.c:208 msgid "VT 100 frames" msgstr "Cadres VT 100" -#: src/dialogs/options.c:211 +#: src/dialogs/options.c:209 msgid "Linux or OS/2 frames" msgstr "Cadres Linux ou OS/2" -#: src/dialogs/options.c:212 +#: src/dialogs/options.c:210 msgid "FreeBSD frames" msgstr "Cadres FreeBSD" -#: src/dialogs/options.c:213 +#: src/dialogs/options.c:211 msgid "KOI8-R frames" msgstr "Cadres KOI8-R" -#: src/dialogs/options.c:215 +#: src/dialogs/options.c:213 msgid "Color mode:" msgstr "Mode couleurs:" -#: src/dialogs/options.c:216 +#: src/dialogs/options.c:214 msgid "No colors (mono)" msgstr "Monochrome" -#: src/dialogs/options.c:217 +#: src/dialogs/options.c:215 msgid "16 colors" msgstr "16 couleurs" -#: src/dialogs/options.c:219 +#: src/dialogs/options.c:217 msgid "88 colors" msgstr "88 couleurs" -#: src/dialogs/options.c:222 +#: src/dialogs/options.c:220 msgid "256 colors" msgstr "256 couleurs" -#: src/dialogs/options.c:225 +#: src/dialogs/options.c:223 msgid "true color" msgstr "vraies couleurs" -#: src/dialogs/options.c:309 +#: src/dialogs/options.c:307 msgid "Resize terminal" msgstr "Redimensionner le terminal" -#: src/dialogs/options.c:312 +#: src/dialogs/options.c:310 msgid "Width=" msgstr "Largeur=" -#: src/dialogs/options.c:313 +#: src/dialogs/options.c:311 msgid "Height=" msgstr "Hauteur=" @@ -5670,54 +5591,56 @@ msgstr "temps restant estim msgid "ETA" msgstr "ETA" -#: src/dialogs/status.c:184 +#: src/dialogs/status.c:185 +#, c-format msgid "Enter a mark to set" msgstr "Entrez une marque" -#: src/dialogs/status.c:188 +#: src/dialogs/status.c:189 +#, c-format msgid "Enter a mark to which to jump" msgstr "Entrez la marque à trouver" -#: src/dialogs/status.c:195 +#: src/dialogs/status.c:196 #, c-format msgid "Keyboard prefix: %d" msgstr "Préfixe clavier: %d" -#: src/dialogs/status.c:225 +#: src/dialogs/status.c:226 #, c-format msgid "Cursor position: %dx%d" msgstr "Position du curseur: %dx%d" -#: src/dialogs/status.c:325 +#: src/dialogs/status.c:326 msgid "Untitled" msgstr "Sans titre" -#: src/dialogs/status.c:327 +#: src/dialogs/status.c:328 msgid "No document" msgstr "Aucun document" #. name: -#: src/document/css/css.c:28 src/document/css/css.c:155 +#: src/document/css/css.c:29 src/document/css/css.c:159 msgid "Cascading Style Sheets" msgstr "Feuilles de style (CSS)" -#: src/document/css/css.c:30 +#: src/document/css/css.c:31 msgid "Options concerning how to use CSS for styling documents." msgstr "Options concernant l'utilisation des CSS." -#: src/document/css/css.c:32 +#: src/document/css/css.c:33 msgid "Enable CSS" msgstr "Activer les CSS" -#: src/document/css/css.c:34 +#: src/document/css/css.c:35 msgid "Enable adding of CSS style info to documents." msgstr "Permettre l'ajout d'info de style CSS aux documents." -#: src/document/css/css.c:36 +#: src/document/css/css.c:37 msgid "Import external style sheets" msgstr "Importer les feuilles de style externes" -#: src/document/css/css.c:38 +#: src/document/css/css.c:39 msgid "" "When enabled any external style sheets that are imported from\n" "either CSS itself using the @import keyword or from the HTML using\n" @@ -5727,11 +5650,11 @@ msgstr "" "soit par le mot clé @import soit par une balise dans l'en-tête du\n" "document sera effectivement téléchargée." -#: src/document/css/css.c:42 +#: src/document/css/css.c:43 msgid "Default style sheet" msgstr "Feuille de style par défaut" -#: src/document/css/css.c:44 +#: src/document/css/css.c:45 msgid "" "The path to the file containing the default user defined\n" "Cascading Style Sheet. It can be used to control the basic\n" @@ -5746,7 +5669,7 @@ msgstr "" "Laisser à \"\" pour utiliser le style initial du document." #. name: -#: src/ecmascript/ecmascript.c:41 src/ecmascript/ecmascript.c:345 +#: src/ecmascript/ecmascript.c:41 src/ecmascript/ecmascript.c:348 msgid "ECMAScript" msgstr "ECMAScript" @@ -5813,7 +5736,12 @@ msgstr "" "qu'il y a un bogue dans ce script et que cela aurait pû\n" "bloquer ELinks, l'exécution du script a donc été interrompue." -#: src/ecmascript/see/window.c:224 src/ecmascript/spidermonkey/window.c:331 +#. name: +#: src/ecmascript/see.c:184 +msgid "SEE" +msgstr "SEE" + +#: src/ecmascript/see/window.c:227 src/ecmascript/spidermonkey/window.c:331 msgid "JavaScript Alert" msgstr "Alerte JavaScript" @@ -5826,6 +5754,11 @@ msgstr "Un script contenu dans le document courant a provoqu msgid "JavaScript Error" msgstr "Erreur Javascript" +#. name: +#: src/ecmascript/spidermonkey.c:315 +msgid "SpiderMonkey" +msgstr "SpiderMonkey" + #: src/formhist/dialogs.c:67 msgid "Forms are never saved for this URL." msgstr "Les formulaires ne sont jamais sauvés pour cette URL." @@ -5924,11 +5857,11 @@ msgstr "" "Cette option désactive seulement le dialogue, les formulaires\n" "déjà mémorisés ne sont pas affectés." -#: src/formhist/formhist.c:413 +#: src/formhist/formhist.c:426 msgid "Form history" msgstr "Historique des formulaires" -#: src/formhist/formhist.c:414 +#: src/formhist/formhist.c:427 msgid "" "Should this login be remembered?\n" "\n" @@ -5945,12 +5878,12 @@ msgstr "" "Si ces informations sont sensibles, répondez NON." #. accelerator_context(memorize_form) -#: src/formhist/formhist.c:421 +#: src/formhist/formhist.c:434 msgid "Ne~ver for this site" msgstr "~Jamais pour ce site" #. name: -#: src/formhist/formhist.c:440 +#: src/formhist/formhist.c:453 msgid "Form History" msgstr "Historique des Formulaires" @@ -6045,7 +5978,7 @@ msgstr "" "1 afficher les titres des pages" #. name: -#: src/globhist/globhist.c:448 +#: src/globhist/globhist.c:451 msgid "Global History" msgstr "Historique Global" @@ -6181,12 +6114,13 @@ msgstr "Turque" msgid "Ukrainian" msgstr "Ukrainien" -#: src/main/interlink.c:329 src/main/select.c:257 +#: src/main/interlink.c:329 src/main/select.c:261 #, c-format msgid "The call to %s failed: %d (%s)" msgstr "L'appel à %s a échoué: %d (%s)" #: src/main/main.c:136 +#, c-format msgid "Cannot create a pipe for internal communication." msgstr "Ne peut créer un tube pour la communication interne." @@ -6196,24 +6130,28 @@ msgid "URL expected after -%s" msgstr "URL attendue après -%s" #: src/main/main.c:210 +#, c-format msgid "No running ELinks found." msgstr "Aucun ELinks en cours d'exécution." #. The remote session(s) can not be created #: src/main/main.c:216 +#, c-format msgid "No remote session to connect to." msgstr "Aucune session distante à laquelle se connecter." #: src/main/main.c:224 +#, c-format msgid "Unable to encode session info." msgstr "Impossible d'encoder les infos de session." #: src/main/main.c:241 +#, c-format msgid "Unable to attach_terminal()." msgstr "Echec de attach_terminal()." #. Infinite loop prevention. -#: src/main/select.c:260 +#: src/main/select.c:264 #, c-format msgid "%d select() failures." msgstr "%d échecs de select()." @@ -6495,7 +6433,7 @@ msgid "No extensions" msgstr "Aucune extension" #. name: -#: src/mime/mime.c:38 src/mime/mime.c:359 +#: src/mime/mime.c:38 src/mime/mime.c:360 msgid "MIME" msgstr "MIME" @@ -6576,111 +6514,111 @@ msgstr "SSL" msgid "SSL options." msgstr "Options SSL." -#: src/network/state.c:26 +#: src/network/state.c:27 msgid "Waiting in queue" msgstr "en liste d'attente" -#: src/network/state.c:27 +#: src/network/state.c:28 msgid "Looking up host" msgstr "Recherche de l'hôte" -#: src/network/state.c:28 +#: src/network/state.c:29 msgid "Making connection" msgstr "Établissement de la connexion" -#: src/network/state.c:29 +#: src/network/state.c:30 msgid "SSL negotiation" msgstr "Négociation SSL" -#: src/network/state.c:30 +#: src/network/state.c:31 msgid "Request sent" msgstr "Requête transmise" -#: src/network/state.c:31 +#: src/network/state.c:32 msgid "Logging in" msgstr "Authentification" -#: src/network/state.c:32 +#: src/network/state.c:33 msgid "Getting headers" msgstr "Réception des en-têtes" -#: src/network/state.c:33 +#: src/network/state.c:34 msgid "Server is processing request" msgstr "Le serveur traîte la requête" -#: src/network/state.c:34 +#: src/network/state.c:35 msgid "Transferring" msgstr "Transfert en cours" -#: src/network/state.c:36 +#: src/network/state.c:37 msgid "Resuming" msgstr "Reprise" -#: src/network/state.c:37 +#: src/network/state.c:38 msgid "Connecting to peers" msgstr "Connexion aux peers" -#: src/network/state.c:38 +#: src/network/state.c:39 msgid "Connecting to tracker" msgstr "Connexion au tracker" -#: src/network/state.c:41 +#: src/network/state.c:42 msgid "Waiting for redirect confirmation" msgstr "Attente de confirmation de redirection" -#: src/network/state.c:42 +#: src/network/state.c:43 msgid "OK" msgstr "OK" -#: src/network/state.c:43 +#: src/network/state.c:44 msgid "Interrupted" msgstr "Interrompu" -#: src/network/state.c:44 +#: src/network/state.c:45 msgid "Socket exception" msgstr "Exception socket" -#: src/network/state.c:45 src/scripting/python/dialogs.c:59 +#: src/network/state.c:46 src/scripting/python/dialogs.c:59 #: src/scripting/python/dialogs.c:188 src/scripting/python/keybinding.c:98 #: src/scripting/python/load.c:113 src/scripting/python/menu.c:98 #: src/scripting/python/open.c:59 msgid "Internal error" msgstr "Erreur interne" -#: src/network/state.c:48 +#: src/network/state.c:49 msgid "Error writing to socket" msgstr "Erreur d'écriture sur le socket" -#: src/network/state.c:49 +#: src/network/state.c:50 msgid "Error reading from socket" msgstr "Erreur de lecture sur le socket" -#: src/network/state.c:50 +#: src/network/state.c:51 msgid "Data modified" msgstr "Données modifiées" -#: src/network/state.c:51 src/scripting/python/load.c:119 +#: src/network/state.c:52 src/scripting/python/load.c:119 #: src/scripting/python/open.c:65 msgid "Bad URL syntax" msgstr "Erreur de syntaxe dans l'URL" -#: src/network/state.c:53 +#: src/network/state.c:54 msgid "Request must be restarted" msgstr "Re-transmission de la requête" -#: src/network/state.c:54 +#: src/network/state.c:55 msgid "Can't get socket state" msgstr "Impossible d'obtenir l'état du socket" -#: src/network/state.c:55 +#: src/network/state.c:56 msgid "Only local connections are permitted" msgstr "Seules les connexions locales sont permises" -#: src/network/state.c:56 +#: src/network/state.c:57 msgid "No host in the specified IP family was found" msgstr "Aucun hôte dans la famille IP spécifiée n'a été trouvé" -#: src/network/state.c:58 +#: src/network/state.c:59 msgid "" "Error while decoding file. This might be caused\n" "by the encoded file being corrupt." @@ -6688,7 +6626,7 @@ msgstr "" "Erreur lors du décodage du fichier. Le fichier est peut-être\n" "corrompu." -#: src/network/state.c:61 +#: src/network/state.c:62 msgid "" "This URL contains a protocol not yet known by ELinks.\n" "You can configure an external handler for it through\n" @@ -6698,7 +6636,7 @@ msgstr "" "Vous pouvez configurer la gestion de ce protocole par un\n" "programme externe grâce au système d'options." -#: src/network/state.c:65 +#: src/network/state.c:66 msgid "" "This URL contains a protocol that is not natively known\n" "by ELinks which means that ELinks relies on external\n" @@ -6710,71 +6648,71 @@ msgstr "" "la manipuler. Télécharger des URLs en utilisant des programmes\n" "externes n'est pas supporté." -#: src/network/state.c:70 +#: src/network/state.c:71 msgid "Bad HTTP response" msgstr "Réponse HTTP incorrecte" -#: src/network/state.c:71 +#: src/network/state.c:72 msgid "No content" msgstr "Aucun contenu" -#: src/network/state.c:73 +#: src/network/state.c:74 msgid "Unknown file type" msgstr "Type de fichier inconnu" -#: src/network/state.c:74 +#: src/network/state.c:75 msgid "Error opening file" msgstr "Erreur lors de l'ouverture du fichier" -#: src/network/state.c:75 +#: src/network/state.c:76 msgid "CGI script not in CGI path" msgstr "Script CGI absent du chemin des CGIs" -#: src/network/state.c:76 +#: src/network/state.c:77 msgid "Local file access is not allowed in anonymous mode" msgstr "L'accès aux fichiers locaux n'est pas autorisé en mode anonyme" -#: src/network/state.c:79 +#: src/network/state.c:80 msgid "Bad FTP response" msgstr "Réponse FTP incorrecte" -#: src/network/state.c:80 +#: src/network/state.c:81 msgid "FTP service unavailable" msgstr "Service FTP indisponible" -#: src/network/state.c:81 +#: src/network/state.c:82 msgid "Bad FTP login" msgstr "Échec de l'authentification FTP" -#: src/network/state.c:82 +#: src/network/state.c:83 msgid "FTP PORT command failed" msgstr "Échec de la commande FTP PORT" -#: src/network/state.c:83 +#: src/network/state.c:84 msgid "File not found" msgstr "Fichier introuvable" -#: src/network/state.c:84 +#: src/network/state.c:85 msgid "FTP file error" msgstr "Erreur de fichier FTP" -#: src/network/state.c:88 +#: src/network/state.c:89 msgid "SSL error" msgstr "Erreur SSL" -#: src/network/state.c:90 +#: src/network/state.c:91 msgid "This version of ELinks does not contain SSL/TLS support" msgstr "Cette version d'ELinks ne supporte ni SSL ni TLS" -#: src/network/state.c:93 +#: src/network/state.c:94 msgid "JavaScript support is not enabled" msgstr "Le support du Javascript n'est pas activé" -#: src/network/state.c:96 +#: src/network/state.c:97 msgid "Bad NNTP response" msgstr "Réponse NNTP incorrecte" -#: src/network/state.c:97 +#: src/network/state.c:98 msgid "" "Unable to handle news: URI because no news server has been\n" "been configured. Either set the option protocol.nntp.server\n" @@ -6784,35 +6722,35 @@ msgstr "" "n'a été configuré. Configurez l'option protocol.nntp.server\n" "ou la variable d'environnement NNTPSERVER." -#: src/network/state.c:100 +#: src/network/state.c:101 msgid "Server hang up for some reason" msgstr "Le serveur est bloqué pour une raison inconnue" -#: src/network/state.c:101 +#: src/network/state.c:102 msgid "No such newsgroup" msgstr "Groupe de nouvelles introuvable" -#: src/network/state.c:102 +#: src/network/state.c:103 msgid "No such article" msgstr "Article introuvable" -#: src/network/state.c:103 +#: src/network/state.c:104 msgid "Transfer failed" msgstr "Echec de transfert" -#: src/network/state.c:104 +#: src/network/state.c:105 msgid "Authorization required" msgstr "Authentication requise" -#: src/network/state.c:105 +#: src/network/state.c:106 msgid "Access to server denied" msgstr "Accès au serveur refusé" -#: src/network/state.c:109 +#: src/network/state.c:110 msgid "The CSO phone-book protocol is not supported." msgstr "Le protocole de carnet d'adresse CSO n'est pas supporté." -#: src/network/state.c:112 +#: src/network/state.c:113 msgid "" "Configuration of the proxy server failed.\n" "This might be caused by an incorrect proxy\n" @@ -6831,23 +6769,23 @@ msgstr "" "le nom d'hôte éventuellement suivi de deux points et\n" "du numéro de port. Par exemple: 'localhost:8080'." -#: src/network/state.c:122 +#: src/network/state.c:123 msgid "BitTorrent error" msgstr "Erreur de BitTorrent" -#: src/network/state.c:123 +#: src/network/state.c:124 msgid "The BitTorrent metainfo file contained errors" msgstr "Le fichier metainfo de BitTorrent contenait des erreurs" -#: src/network/state.c:124 +#: src/network/state.c:125 msgid "The tracker requesting failed" msgstr "L'interrogation du serveur a échouée" -#: src/network/state.c:125 +#: src/network/state.c:126 msgid "The BitTorrent URL does not point to a valid URL" msgstr "L'URL BitTorrent ne pointe pas sur une URL valide" -#: src/network/state.c:149 +#: src/network/state.c:150 msgid "Unknown error" msgstr "Erreur inconnue" @@ -6881,17 +6819,22 @@ msgstr "~Plein msgid "~BeOS terminal" msgstr "Terminal ~BeOS" +#. name: +#: src/protocol/auth/auth.c:332 +msgid "Authentication" +msgstr "Authentification" + #: src/protocol/auth/dialogs.c:87 #, c-format msgid "Authentication required for %s at %s" -msgstr "Authentication requise pour %s à %s" +msgstr "Authentification requise pour %s à %s" #. This function is used for at least HTTP and FTP, so don't #. * name the protocol here. Consider also what an FTP server #. * behind an HTTP proxy should be called. #: src/protocol/auth/dialogs.c:102 msgid "Authentication required" -msgstr "Authentication requise" +msgstr "Authentification requise" #: src/protocol/auth/dialogs.c:112 msgid "Login" @@ -7524,7 +7467,7 @@ msgid_plural "%u unavailable" msgstr[0] "%u indisponible" msgstr[1] "%u indisponibles" -#: src/protocol/bittorrent/dialogs.c:584 src/session/session.c:281 +#: src/protocol/bittorrent/dialogs.c:584 src/session/session.c:276 #, c-format msgid "Unable to retrieve %s" msgstr "Incapable de récupérer %s" @@ -7538,7 +7481,7 @@ msgstr "Que voulez-vous faire avec le fichier '%s' ?" msgid "Information about the torrent" msgstr "Informations sur le torrent" -#: src/protocol/bittorrent/dialogs.c:774 src/session/download.c:1121 +#: src/protocol/bittorrent/dialogs.c:774 src/session/download.c:1144 msgid "What to do?" msgstr "Que faire ?" @@ -7548,12 +7491,12 @@ msgid "Down~load" msgstr "Té~lécharger" #. accelerator_context(src/protocol/bittorrent/dialogs.c:bittorrent_query_callback, src/session/download.c:do_type_query) -#: src/protocol/bittorrent/dialogs.c:802 src/session/download.c:1233 +#: src/protocol/bittorrent/dialogs.c:802 src/session/download.c:1256 msgid "~Display" msgstr "A~fficher" #. accelerator_context(src/protocol/bittorrent/dialogs.c:bittorrent_query_callback, src/session/download.c:do_type_query) -#: src/protocol/bittorrent/dialogs.c:806 src/session/download.c:1237 +#: src/protocol/bittorrent/dialogs.c:806 src/session/download.c:1260 msgid "Show ~header" msgstr "~Montrer les en-têtes" @@ -7643,19 +7586,19 @@ msgid "Finger" msgstr "Finger" #. name: -#: src/protocol/fsp/fsp.c:44 src/protocol/fsp/fsp.c:56 +#: src/protocol/fsp/fsp.c:45 src/protocol/fsp/fsp.c:57 msgid "FSP" msgstr "FSP" -#: src/protocol/fsp/fsp.c:46 +#: src/protocol/fsp/fsp.c:47 msgid "FSP specific options." msgstr "Options du protocole FSP." -#: src/protocol/fsp/fsp.c:48 +#: src/protocol/fsp/fsp.c:49 msgid "Sort entries" msgstr "Trier les entrées" -#: src/protocol/fsp/fsp.c:50 +#: src/protocol/fsp/fsp.c:51 msgid "Whether to sort entries in directory listings." msgstr "Trier ou non les entrées des répertoires." @@ -7723,16 +7666,17 @@ msgstr "" msgid "Gopher" msgstr "Gopher" -#: src/protocol/http/codes.c:104 +#: src/protocol/http/codes.c:105 #, c-format msgid "HTTP error %03d" msgstr "Erreur HTTP %03d" -#: src/protocol/http/codes.c:127 +#: src/protocol/http/codes.c:128 +#, c-format msgid "" " An error occurred on the server while fetching the document you\n" " requested. However, the server did not send back any explanation of what\n" -" happenned, so it is unknown what went wrong. Please contact the web\n" +" happened, so it is unknown what went wrong. Please contact the web\n" " server administrator about this, if you believe that this error should\n" " not occur since it is not a nice behaviour from the web server at all\n" " and indicates that there is some much deeper problem with the web server\n" @@ -8149,39 +8093,49 @@ msgstr "" msgid "Default template" msgstr "Modèle par défaut" -#: src/protocol/rewrite/rewrite.c:95 +#: src/protocol/rewrite/rewrite.c:96 +#, no-c-format msgid "" "Default URI template used when the string entered in\n" "the goto dialog does not appear to be a URI or a filename\n" "(i.e. contains no '.', ':' or '/' characters), and does\n" "not match any defined prefixes. Set the value to \"\" to\n" -"disable use of the default template rewrite rule." +"disable use of the default template rewrite rule.\n" +"%c in the template means the current URL\n" +"%s in the template means the whole string from the goto dialog\n" +"%0,%1,...,%9 mean the 1st,2nd,...,10th space-delimited part of %s\n" +"%% in the template means '%'" msgstr "" "Modèle d'URI utilisé par défaut quand une chaîne entrée dans\n" "la dialogue \"Atteindre l'URL\" n'est ni une URI ni un fichier\n" "(par exemple, ne contient pas les caractères '.', ':' ou '/'),\n" "et ne correspond à aucun des préfixes définis. Mettre la valeur\n" -"à \"\" pour désactiver l'usage de ce modèle." +"à \"\" pour désactiver l'usage de ce modèle.\n" +"%c signifie l'URL courante\n" +"%s signifie la chaîne complète du dialogue 'Aller à'\n" +"%0,%1,...,%9 signifient les 1ère, 2ème, ..., parties séparées par des " +"espaces de %s\n" +"%% signifie '%'" #. name: -#: src/protocol/rewrite/rewrite.c:367 +#: src/protocol/rewrite/rewrite.c:372 msgid "URI rewrite" msgstr "Ré-écriture d'URI" #. name: -#: src/protocol/smb/smb.c:70 src/protocol/smb/smb.c:82 +#: src/protocol/smb/smb2.c:43 src/protocol/smb/smb2.c:56 msgid "SMB" msgstr "SMB" -#: src/protocol/smb/smb.c:72 +#: src/protocol/smb/smb2.c:45 msgid "SAMBA specific options." msgstr "Options spécifiques de SAMBA." -#: src/protocol/smb/smb.c:74 +#: src/protocol/smb/smb2.c:47 msgid "Credentials" msgstr "Authentification" -#: src/protocol/smb/smb.c:76 +#: src/protocol/smb/smb2.c:49 msgid "Credentials file passed to smbclient via -A option." msgstr "Fichier d'authentification passé à smbclient via l'option -A." @@ -8226,15 +8180,20 @@ msgstr "" "%s dans la chaîne insère le sujet (?subject=)\n" "%u dans la chaîne insère l'URL complète" -#: src/protocol/user.c:263 +#: src/protocol/user.c:276 msgid "No program" msgstr "Aucun programme" -#: src/protocol/user.c:265 +#: src/protocol/user.c:278 #, c-format msgid "No program specified for protocol %s." msgstr "Aucun programme spécifié pour le protocole %s." +#. name: +#: src/scripting/guile/guile.c:16 +msgid "Guile" +msgstr "Guile" + #: src/scripting/lua/core.c:312 src/scripting/python/keybinding.c:151 msgid "Error registering event hook" msgstr "Erreur d'enregistrement d'une fonction de rappel d'événement" @@ -8243,33 +8202,58 @@ msgstr "Erreur d'enregistrement d'une fonction de rappel d' msgid "User dialog" msgstr "Dialogue utilisateur" -#: src/scripting/lua/core.c:742 +#: src/scripting/lua/core.c:740 msgid "Lua Error" msgstr "Erreur Lua" -#: src/scripting/lua/core.c:892 +#: src/scripting/lua/core.c:890 msgid "Lua Console" msgstr "Console Lua" -#: src/scripting/lua/core.c:892 +#: src/scripting/lua/core.c:890 msgid "Enter expression" msgstr "Entrez une expression" +#. name: +#: src/scripting/lua/lua.c:16 +msgid "Lua" +msgstr "Lua" + +#. name: +#: src/scripting/perl/perl.c:16 +msgid "Perl" +msgstr "Perl" + +#. name: +#: src/scripting/python/python.c:18 +msgid "Python" +msgstr "Python" + #: src/scripting/ruby/core.c:131 src/scripting/ruby/core.c:184 msgid "Ruby Message" msgstr "Message Ruby" -#: src/scripting/scripting.c:59 +#. name: +#: src/scripting/ruby/ruby.c:16 +msgid "Ruby" +msgstr "Ruby" + +#: src/scripting/scripting.c:44 +#, c-format +msgid "[%s error] %s" +msgstr "[erreur %s] %s" + +#: src/scripting/scripting.c:60 #, c-format msgid "An error occurred while running a %s script" msgstr "Une erreur s'est produite lors de l'exécution d'un script %s" -#: src/scripting/scripting.c:65 +#: src/scripting/scripting.c:66 msgid "Browser scripting error" msgstr "Erreur de script" #. name: -#: src/scripting/scripting.c:93 +#: src/scripting/scripting.c:94 msgid "Scripting" msgstr "Scripting" @@ -8277,12 +8261,17 @@ msgstr "Scripting" msgid "User script alert" msgstr "Alerte script utilisateur" +#. name: +#: src/scripting/smjs/smjs.c:16 +msgid "Spidermonkey ECMAScript" +msgstr "Spidermonkey ECMAScript" + #: src/session/download.c:235 src/session/download.c:359 -#: src/session/download.c:591 src/session/download.c:679 +#: src/session/download.c:598 src/session/download.c:686 msgid "Download error" msgstr "Erreur de téléchargement" -#: src/session/download.c:236 src/session/download.c:680 +#: src/session/download.c:236 src/session/download.c:687 #, c-format msgid "" "Could not create file '%s':\n" @@ -8302,16 +8291,16 @@ msgstr "" "\n" "%s" -#: src/session/download.c:592 +#: src/session/download.c:599 #, c-format msgid "'%s' is a directory." msgstr "'%s' est un répertoire." -#: src/session/download.c:626 +#: src/session/download.c:633 msgid "File exists" msgstr "Fichier existant" -#: src/session/download.c:627 +#: src/session/download.c:634 #, c-format msgid "" "This file already exists:\n" @@ -8327,63 +8316,67 @@ msgstr "" "%s" #. accelerator_context(src/session/download.c:lookup_unique_name) -#: src/session/download.c:634 +#: src/session/download.c:641 msgid "Sa~ve under the alternative name" msgstr "Sau~ver sous un nom alternatif" #. accelerator_context(src/session/download.c:lookup_unique_name) -#: src/session/download.c:635 +#: src/session/download.c:642 msgid "~Overwrite the original file" msgstr "Ecraser le fichier ~original" #. accelerator_context(src/session/download.c:lookup_unique_name) -#: src/session/download.c:636 +#: src/session/download.c:643 msgid "~Resume download of the original file" msgstr "~Reprendre le téléchargement du fichier original" -#: src/session/download.c:1124 +#: src/session/download.c:1147 msgid "Unknown type" msgstr "Type inconnu" -#: src/session/download.c:1149 +#: src/session/download.c:1172 #, c-format msgid "What would you like to do with the file '%s' (type: %s%s%s)?" msgstr "Que voulez-vous faire avec le fichier '%s' (type: %s%s%s) ?" -#: src/session/download.c:1152 +#: src/session/download.c:1175 #, c-format msgid "What would you like to do with the file (type: %s%s%s)?" msgstr "Que voulez-vous faire avec le fichier (type: %s%s%s) ?" -#: src/session/download.c:1183 +#: src/session/download.c:1206 #, no-c-format msgid "Program ('%' will be replaced by the filename)" msgstr "Programme ('%' sera remplacé par le nom du fichier)" -#: src/session/download.c:1188 +#: src/session/download.c:1211 msgid "The output of the program will be shown in the tab" msgstr "La sortie du programme sera montrée dans l'onglet" -#: src/session/download.c:1192 +#: src/session/download.c:1215 msgid "Block the terminal" msgstr "Bloquer le terminal" -#: src/session/download.c:1199 +#: src/session/download.c:1222 #, c-format msgid "The file will be opened with the program '%s'." msgstr "Le fichier sera ouvert avec le programme '%s'." #. accelerator_context(src/session/download.c:do_type_query) -#: src/session/download.c:1220 +#: src/session/download.c:1243 msgid "~Open" msgstr "~Ouvrir" -#: src/session/session.c:762 src/session/session.c:781 src/session/task.c:270 -#: src/viewer/text/textarea.c:625 +#. Casting size_t fc_maxlength to unsigned int +#. * and formatting it with "%u" is safe, +#. * because fc_maxlength is smaller than +#. * file.length, which is an int. +#: src/session/session.c:757 src/session/session.c:776 src/session/task.c:274 +#: src/viewer/text/textarea.c:648 msgid "Warning" msgstr "Avertissement" -#: src/session/session.c:763 +#: src/session/session.c:758 msgid "" "You have empty string in protocol.http.user_agent - this was a default value " "in the past, substituted by default ELinks User-Agent string. However, " @@ -8402,7 +8395,7 @@ msgstr "" "défaut sera utilisée. Si vous n'avez aucune idée de quoi nous parlons alors " "faites juste ça. Toutes nos excuses pour ce désagrément." -#: src/session/session.c:782 +#: src/session/session.c:777 msgid "" "You have option config.saving_style set to a de facto obsolete value. The " "configuration saving algorithms of ELinks were changed from the last time " @@ -8423,11 +8416,11 @@ msgstr "" "l'option config.saving_style dans le but d'obtenir un fonctionnement " "correct. Toutes nos excuses pour l'éventuel désagrément causé." -#: src/session/session.c:807 +#: src/session/session.c:802 msgid "Welcome" msgstr "Bienvenue" -#: src/session/session.c:808 +#: src/session/session.c:803 msgid "" "Welcome to ELinks!\n" "\n" @@ -8438,7 +8431,7 @@ msgstr "" "Pressez ESC pour accèder au menu.\n" "La documentation est disponible dans le menu Aide." -#: src/session/task.c:238 +#: src/session/task.c:242 #, c-format msgid "" "The URL you are about to follow might be maliciously crafted in order to " @@ -8454,14 +8447,14 @@ msgstr "" "\n" "Voulez-vous aller à l'URL %s ?" -#: src/session/task.c:248 +#: src/session/task.c:252 #, c-format msgid "Do you want to follow the redirect and post form data to URL %s?" msgstr "" "Voulez-vous suivre la redirection et poster les données de formulaire à " "l'URL %s ?" -#: src/session/task.c:252 +#: src/session/task.c:256 #, c-format msgid "" "The form data you are about to post might be incomplete.\n" @@ -8470,12 +8463,12 @@ msgstr "" "Le formulaire que vous tentez de soumettre est peut-être incomplet.\n" "Voulez-vous tout de même le soumettre à l'URL %s ?" -#: src/session/task.c:256 +#: src/session/task.c:260 #, c-format msgid "Do you want to post form data to URL %s?" msgstr "Voulez-vous poster les données de formulaire à l'URL %s ?" -#: src/session/task.c:259 +#: src/session/task.c:263 #, c-format msgid "Do you want to repost form data to URL %s?" msgstr "Voulez-vous re-poster les données de formulaire à l'URL %s ?" @@ -8486,54 +8479,90 @@ msgid "Bad terminal size: %d, %d" msgstr "Mauvaise taille de terminal: %d, %d" #: src/terminal/event.c:170 +#, c-format msgid "Warning: terminal name contains illicit chars." msgstr "Attention: le nom du terminal contient des caractères illicites." -#: src/terminal/event.c:251 +#: src/terminal/event.c:255 +#, c-format msgid "Failed to create session." msgstr "Echec de création de session." -#: src/terminal/event.c:439 +#: src/terminal/event.c:442 #, c-format msgid "Bad event %d" msgstr "Mauvais évènement %d" -#: src/terminal/event.c:479 +#: src/terminal/event.c:482 #, c-format msgid "Could not read event: %d (%s)" msgstr "Impossible de lire l'évènement: %d (%s)" #: src/terminal/kbd.c:1172 +#, c-format msgid "Too many bytes read from the itrm!" msgstr "Trop d'octets lus en provenance de itrm!" -#: src/terminal/tab.c:204 +#: src/terminal/tab.c:205 msgid "Do you really want to close the current tab?" msgstr "Êtes-vous sûr de vouloir fermer l'onglet courant ?" -#: src/terminal/tab.c:247 +#: src/terminal/tab.c:249 msgid "Do you really want to close all except the current tab?" msgstr "Êtes-vous sûr de vouloir fermer tout sauf l'onglet courant ?" +#: src/util/secsave.c:361 +msgid "Cannot read the file" +msgstr "Échec de lecture du fichier" + +#: src/util/secsave.c:363 +msgid "Cannot get file status" +msgstr "Impossible d'obtenir l'état du fichier" + +#: src/util/secsave.c:365 +msgid "Cannot access the file" +msgstr "Échec d'accès au fichier" + +#: src/util/secsave.c:367 +msgid "Cannot create temp file" +msgstr "Échec de création de fichier temporaire" + +#: src/util/secsave.c:369 +msgid "Cannot rename the file" +msgstr "Échec du renommage du fichier" + +#: src/util/secsave.c:371 +msgid "File saving disabled by option" +msgstr "Sauvegarde de fichier désactivée par option" + +#: src/util/secsave.c:375 +msgid "Cannot write the file" +msgstr "Ecriture du fichier impossible" + +#: src/util/secsave.c:379 +msgid "Secure file saving error" +msgstr "Erreur de sauvegarde fiable du fichier" + #: src/viewer/dump/dump.c:87 #, c-format msgid "Can't write to stdout: %s" msgstr "Ne peut écrire sur la sortie standard: %s" #: src/viewer/dump/dump.c:90 +#, c-format msgid "Can't write to stdout." msgstr "Ne peut écrire sur la sortie standard." -#: src/viewer/dump/dump.c:285 +#: src/viewer/dump/dump.c:286 #, c-format msgid "URL protocol not supported (%s)." msgstr "Protocole de l'URL non supporté (%s)." -#: src/viewer/text/draw.c:76 +#: src/viewer/text/draw.c:77 msgid "Missing fragment" msgstr "Ancre manquante" -#: src/viewer/text/draw.c:77 +#: src/viewer/text/draw.c:78 #, c-format msgid "The requested fragment \"%s\" doesn't exist." msgstr "L'ancre demandée \"%s\" n'existe pas." @@ -8547,271 +8576,277 @@ msgstr "Erreur lors de l'envoi du formulaire" msgid "Could not load file %s: %s" msgstr "Impossible de charger le fichier %s: %s" -#: src/viewer/text/form.c:1786 +#: src/viewer/text/form.c:1787 msgid "Reset form" msgstr "Réinitialiser le formulaire" -#: src/viewer/text/form.c:1788 +#: src/viewer/text/form.c:1789 msgid "Harmless button" msgstr "Bouton sans impact" -#: src/viewer/text/form.c:1796 +#: src/viewer/text/form.c:1797 msgid "Submit form to" msgstr "Envoi du formulaire à" -#: src/viewer/text/form.c:1797 +#: src/viewer/text/form.c:1798 msgid "Post form to" msgstr "Transfert du formulaire à" -#: src/viewer/text/form.c:1799 +#: src/viewer/text/form.c:1800 msgid "Radio button" msgstr "Bouton radio" -#: src/viewer/text/form.c:1803 +#: src/viewer/text/form.c:1804 msgid "Select field" msgstr "Liste" -#: src/viewer/text/form.c:1807 +#: src/viewer/text/form.c:1808 msgid "Text area" msgstr "Champ texte multiligne" -#: src/viewer/text/form.c:1809 +#: src/viewer/text/form.c:1810 msgid "File upload" msgstr "Envoi de fichier" -#: src/viewer/text/form.c:1811 +#: src/viewer/text/form.c:1812 msgid "Password field" msgstr "Champ mot de passe" -#: src/viewer/text/form.c:1849 +#: src/viewer/text/form.c:1850 msgid "name" msgstr "Nom" -#: src/viewer/text/form.c:1861 +#: src/viewer/text/form.c:1862 msgid "value" msgstr "Valeur" -#: src/viewer/text/form.c:1874 +#: src/viewer/text/form.c:1875 msgid "read only" msgstr "lecture seule" -#: src/viewer/text/form.c:1885 +#: src/viewer/text/form.c:1886 #, c-format msgid "press %s to navigate" msgstr "pressez %s pour naviguer" -#: src/viewer/text/form.c:1887 +#: src/viewer/text/form.c:1888 #, c-format msgid "press %s to edit" msgstr "pressez %s pour éditer" -#: src/viewer/text/form.c:1923 +#: src/viewer/text/form.c:1924 #, c-format msgid "press %s to submit to %s" msgstr "pressez %s pour soumettre à %s" -#: src/viewer/text/form.c:1925 +#: src/viewer/text/form.c:1926 #, c-format msgid "press %s to post to %s" msgstr "pressez %s pour poster à %s" -#: src/viewer/text/form.c:2027 +#: src/viewer/text/form.c:2028 msgid "Useless button" msgstr "Bouton inutile" -#: src/viewer/text/form.c:2029 +#: src/viewer/text/form.c:2030 msgid "Submit button" msgstr "Bouton Soumettre" #. accelerator_context(link_menu.map) -#: src/viewer/text/link.c:1273 +#: src/viewer/text/link.c:1278 msgid "Display ~usemap" msgstr "Afficher ~usemap" #. accelerator_context(link_menu.std) -#: src/viewer/text/link.c:1278 +#: src/viewer/text/link.c:1283 msgid "~Follow link" msgstr "~Suivre le lien" #. accelerator_context(link_menu.std) -#: src/viewer/text/link.c:1280 +#: src/viewer/text/link.c:1285 msgid "Follow link and r~eload" msgstr "Suivre le lien et ~recharger" #. accelerator_context(link_menu.std) -#: src/viewer/text/link.c:1284 +#: src/viewer/text/link.c:1289 msgid "Open in new ~window" msgstr "Ouvrir dans une nouvelle ~fenêtre" #. accelerator_context(link_menu.std) -#: src/viewer/text/link.c:1286 +#: src/viewer/text/link.c:1291 msgid "Open in new ~tab" msgstr "Ouvrir dans un nouvel ongle~t" #. accelerator_context(link_menu.std) -#: src/viewer/text/link.c:1288 +#: src/viewer/text/link.c:1293 msgid "Open in new tab in ~background" msgstr "Ouvrir dans un nouvel onglet en arrière-~plan" #. accelerator_context(link_menu.std) -#: src/viewer/text/link.c:1293 +#: src/viewer/text/link.c:1298 msgid "~Download link" msgstr "~Enregistrer le lien" #. accelerator_context(link_menu.std) -#: src/viewer/text/link.c:1296 +#: src/viewer/text/link.c:1301 msgid "~Add link to bookmarks" msgstr "~Ajouter ce lien aux signets" #. accelerator_context(link_menu.std) -#: src/viewer/text/link.c:1300 +#: src/viewer/text/link.c:1305 msgid "Pass link URI to e~xternal command" msgstr "Passer l'URI du lien à une commande e~xterne" #. accelerator_context(link_menu.form, link_menu.reset, link_menu.textarea) -#: src/viewer/text/link.c:1311 src/viewer/text/link.c:1351 +#: src/viewer/text/link.c:1316 src/viewer/text/link.c:1356 msgid "~Reset form" msgstr "Remettre à ~zéro le formulaire" #. accelerator_context(link_menu.textarea) -#: src/viewer/text/link.c:1326 +#: src/viewer/text/link.c:1331 msgid "Open in ~external editor" msgstr "Ouvrir dans un ~éditeur externe" #. accelerator_context(link_menu.form, link_menu.textarea) -#: src/viewer/text/link.c:1334 +#: src/viewer/text/link.c:1339 msgid "~Submit form" msgstr "~Envoyer le formulaire" #. accelerator_context(link_menu.form, link_menu.textarea) -#: src/viewer/text/link.c:1335 +#: src/viewer/text/link.c:1340 msgid "Submit form and rel~oad" msgstr "Envoyer le formulaire et ~recharger" #. accelerator_context(link_menu.form, link_menu.textarea) -#: src/viewer/text/link.c:1339 +#: src/viewer/text/link.c:1344 msgid "Submit form and open in new ~window" msgstr "Envoyer le formulaire et ouvrir dans une nouvelle ~fenêtre" #. accelerator_context(link_menu.form, link_menu.textarea) -#: src/viewer/text/link.c:1341 +#: src/viewer/text/link.c:1346 msgid "Submit form and open in new ~tab" msgstr "Envoyer le formulaire et ouvrir un ~onglet" #. accelerator_context(link_menu.form, link_menu.textarea) -#: src/viewer/text/link.c:1344 +#: src/viewer/text/link.c:1349 msgid "Submit form and open in new tab in ~background" msgstr "Envoyer le formulaire et ouvrir un onglet en ~arrière-plan" #. accelerator_context(link_menu.form, link_menu.textarea) -#: src/viewer/text/link.c:1349 +#: src/viewer/text/link.c:1354 msgid "Submit form and ~download" msgstr "Envoyer le formulaire et ~télécharger" #. accelerator_context(link_menu.form, link_menu.reset, link_menu.textarea) -#: src/viewer/text/link.c:1356 +#: src/viewer/text/link.c:1361 msgid "Form f~ields" msgstr "C~hamps de formulaire" #. accelerator_context(link_menu.form, link_menu.map, link_menu.std) -#: src/viewer/text/link.c:1363 +#: src/viewer/text/link.c:1368 msgid "V~iew image" msgstr "~Voir l'image" #. accelerator_context(link_menu.form, link_menu.map, link_menu.std) -#: src/viewer/text/link.c:1365 +#: src/viewer/text/link.c:1370 msgid "Download ima~ge" msgstr "Enregistrer l'~image" -#: src/viewer/text/link.c:1374 +#: src/viewer/text/link.c:1379 msgid "No link selected" msgstr "Aucun lien sélectionné" -#: src/viewer/text/link.c:1444 +#: src/viewer/text/link.c:1449 msgid "Image" msgstr "Image" -#: src/viewer/text/link.c:1449 +#: src/viewer/text/link.c:1454 msgid "Usemap" msgstr "Usemap" -#: src/viewer/text/search.c:1078 +#. name: +#: src/viewer/text/marks.c:155 +msgid "Marks" +msgstr "Marques" + +#: src/viewer/text/search.c:1081 msgid "Search hit top, continuing at bottom." msgstr "La recherche a atteint le haut du document, poursuite à partir du bas." -#: src/viewer/text/search.c:1079 +#: src/viewer/text/search.c:1082 msgid "Search hit bottom, continuing at top." msgstr "La recherche a atteint le bas du document, poursuite à partir du haut." -#: src/viewer/text/search.c:1082 +#: src/viewer/text/search.c:1085 msgid "No previous search" msgstr "Aucune clef de recherche" -#: src/viewer/text/search.c:1094 +#: src/viewer/text/search.c:1097 #, c-format msgid "Could not compile regular expression '%s'" msgstr "Ne peut compiler l'expression régulière '%s'" -#: src/viewer/text/search.c:1137 +#: src/viewer/text/search.c:1140 #, c-format msgid "No further matches for '%s'." msgstr "Aucune autre correspondance pour '%s'." -#: src/viewer/text/search.c:1139 +#: src/viewer/text/search.c:1142 #, c-format msgid "Could not find a link with the text '%s'." msgstr "Ne peut trouver un lien avec le texte '%s'." -#: src/viewer/text/search.c:1141 src/viewer/text/search.c:1549 +#: src/viewer/text/search.c:1144 src/viewer/text/search.c:1552 msgid "Typeahead" msgstr "Préfrappe" -#: src/viewer/text/search.c:1551 +#: src/viewer/text/search.c:1554 +#, c-format msgid "No links in current document" msgstr "Aucun lien dans le document courant" -#: src/viewer/text/search.c:1629 +#: src/viewer/text/search.c:1632 msgid "Search for text" msgstr "Recherche du texte" -#: src/viewer/text/search.c:1660 +#: src/viewer/text/search.c:1663 msgid "Normal search" msgstr "Plein texte" -#: src/viewer/text/search.c:1661 +#: src/viewer/text/search.c:1664 msgid "Regexp search" msgstr "Expression régulière" -#: src/viewer/text/search.c:1662 +#: src/viewer/text/search.c:1665 msgid "Extended regexp search" msgstr "Expression régulière étendue" -#: src/viewer/text/search.c:1663 +#: src/viewer/text/search.c:1666 msgid "Case sensitive" msgstr "Respecter la casse" -#: src/viewer/text/search.c:1664 +#: src/viewer/text/search.c:1667 msgid "Case insensitive" msgstr "Ignorer la casse" -#: src/viewer/text/search.c:1688 +#: src/viewer/text/search.c:1691 msgid "Search backward" msgstr "Chercher en arrière" #. name: -#: src/viewer/text/search.c:1727 +#: src/viewer/text/search.c:1730 msgid "Search History" msgstr "Historique des recherches" -#: src/viewer/text/textarea.c:572 +#: src/viewer/text/textarea.c:591 msgid "You cannot launch an external editor in the anonymous mode." msgstr "Vous ne pouvez utiliser un éditeur externe en mode anonyme." -#: src/viewer/text/textarea.c:579 +#: src/viewer/text/textarea.c:598 msgid "You can do this only on the master terminal" msgstr "Vous ne pouvez faire ça que dans le terminal maître" -#: src/viewer/text/textarea.c:628 +#: src/viewer/text/textarea.c:651 #, c-format msgid "" "You have exceeded the textarea's size limit: your input is %d bytes, but the " @@ -8842,6 +8877,11 @@ msgstr "Erreur lors de la sauvegarde" msgid "Error writing to file" msgstr "Erreur lors de l'écriture du fichier" +#. name: +#: src/viewer/timer.c:88 +msgid "Timer" +msgstr "Temporisation" + #. name: #: src/viewer/viewer.c:25 msgid "Viewer" diff --git a/po/pl.po b/po/pl.po index a54375b5..70601ec8 100644 --- a/po/pl.po +++ b/po/pl.po @@ -11,8 +11,8 @@ msgid "" msgstr "" "Project-Id-Version: ELinks 0.12.GIT\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-12-09 19:05+0100\n" -"PO-Revision-Date: 2006-12-09 19:30+0100\n" +"POT-Creation-Date: 2007-03-23 13:49+0100\n" +"PO-Revision-Date: 2007-03-23 14:10+0100\n" "Last-Translator: Witold Filipczyk \n" "Language-Team: Polish \n" "MIME-Version: 1.0\n" @@ -38,13 +38,13 @@ msgstr "Wci #. accelerator_context(do_auth_dialog, do_edit_dialog, generic_external_protocol_handler, info_box, input_dialog, menu_add_ext, menu_keys, push_hierbox_info_button, python_info_box, refreshed_msg_box, resize_terminal_dialog, setup_first_session, src/config/dialogs.c:build_edit_dialog, src/cookies/dialogs.c:build_edit_dialog, src/cookies/dialogs.c:push_add_server_button, src/scripting/lua/core.c:l_edit_bookmark_dialog, src/scripting/lua/core.c:l_xdialog, src/viewer/text/search.c:search_dlg_do, terminal_options, write_config_dialog) #: src/bfu/hierbox.c:441 src/bfu/inpfield.c:256 src/bfu/msgbox.c:173 -#: src/bfu/msgbox.c:191 src/config/dialogs.c:58 src/config/dialogs.c:393 -#: src/cookies/dialogs.c:356 src/cookies/dialogs.c:454 src/dialogs/edit.c:98 -#: src/dialogs/info.c:134 src/dialogs/options.c:234 src/dialogs/options.c:315 +#: src/bfu/msgbox.c:194 src/config/dialogs.c:57 src/config/dialogs.c:365 +#: src/cookies/dialogs.c:372 src/cookies/dialogs.c:470 src/dialogs/edit.c:98 +#: src/dialogs/info.c:134 src/dialogs/options.c:232 src/dialogs/options.c:313 #: src/mime/dialogs.c:131 src/protocol/auth/dialogs.c:115 #: src/protocol/protocol.c:236 src/scripting/lua/core.c:390 #: src/scripting/lua/core.c:471 src/scripting/python/dialogs.c:86 -#: src/session/session.c:812 src/viewer/text/search.c:1666 +#: src/session/session.c:807 src/viewer/text/search.c:1669 msgid "~OK" msgstr "~OK" @@ -125,34 +125,34 @@ msgid "Delete error" msgstr "B³±d przy usuwaniu" #. accelerator_context(close_all_tabs_but_current, close_tab, memorize_form, menu_del_ext, push_hierbox_clear_button, push_hierbox_delete_button, query_delete_selected_item, query_exit, ses_goto, src/config/dialogs.c:really_add_keybinding.yn) -#: src/bfu/hierbox.c:754 src/bfu/hierbox.c:766 src/bfu/hierbox.c:808 -#: src/bfu/hierbox.c:870 src/config/dialogs.c:851 src/dialogs/menu.c:127 -#: src/formhist/formhist.c:419 src/mime/dialogs.c:70 src/session/task.c:273 -#: src/terminal/tab.c:206 src/terminal/tab.c:249 +#: src/bfu/hierbox.c:754 src/bfu/hierbox.c:766 src/bfu/hierbox.c:814 +#: src/bfu/hierbox.c:876 src/config/dialogs.c:823 src/dialogs/menu.c:131 +#: src/formhist/formhist.c:432 src/mime/dialogs.c:70 src/session/task.c:277 +#: src/terminal/tab.c:207 src/terminal/tab.c:251 msgid "~Yes" msgstr "~Tak" #. accelerator_context(close_all_tabs_but_current, close_tab, memorize_form, menu_del_ext, push_hierbox_clear_button, push_hierbox_delete_button, query_delete_selected_item, query_exit, ses_goto, src/config/dialogs.c:really_add_keybinding.yn) -#: src/bfu/hierbox.c:755 src/bfu/hierbox.c:767 src/bfu/hierbox.c:809 -#: src/bfu/hierbox.c:871 src/config/dialogs.c:852 src/dialogs/menu.c:128 -#: src/formhist/formhist.c:420 src/mime/dialogs.c:71 src/session/task.c:274 -#: src/terminal/tab.c:207 src/terminal/tab.c:250 +#: src/bfu/hierbox.c:755 src/bfu/hierbox.c:767 src/bfu/hierbox.c:815 +#: src/bfu/hierbox.c:877 src/config/dialogs.c:824 src/dialogs/menu.c:132 +#: src/formhist/formhist.c:433 src/mime/dialogs.c:71 src/session/task.c:278 +#: src/terminal/tab.c:208 src/terminal/tab.c:252 msgid "~No" msgstr "~Nie" -#: src/bfu/hierbox.c:939 src/bfu/hierbox.c:970 src/viewer/text/search.c:1085 -#: src/viewer/text/search.c:1093 src/viewer/text/search.c:1109 -#: src/viewer/text/search.c:1685 +#: src/bfu/hierbox.c:945 src/bfu/hierbox.c:976 src/viewer/text/search.c:1088 +#: src/viewer/text/search.c:1096 src/viewer/text/search.c:1112 +#: src/viewer/text/search.c:1688 msgid "Search" msgstr "Szukaj" -#: src/bfu/hierbox.c:941 src/viewer/text/search.c:1086 +#: src/bfu/hierbox.c:947 src/viewer/text/search.c:1089 #, c-format msgid "Search string '%s' not found" msgstr "Nie znaleziono wyra¿enia '%s'" -#: src/bfu/hierbox.c:970 src/config/dialogs.c:169 src/config/dialogs.c:359 -#: src/config/dialogs.c:507 src/cookies/dialogs.c:34 src/cookies/dialogs.c:350 +#: src/bfu/hierbox.c:976 src/config/dialogs.c:140 src/config/dialogs.c:329 +#: src/config/dialogs.c:479 src/cookies/dialogs.c:34 src/cookies/dialogs.c:366 #: src/dialogs/edit.c:92 src/dialogs/edit.c:94 src/scripting/lua/core.c:386 #: src/scripting/lua/core.c:387 src/scripting/lua/core.c:468 msgid "Name" @@ -171,7 +171,7 @@ msgstr "Oczekiwano liczby" msgid "Number should be in the range from %d to %d." msgstr "Liczba powinna byæ z zakresu od %d do %d." -#: src/bfu/inpfield.c:99 src/config/dialogs.c:460 +#: src/bfu/inpfield.c:99 src/config/dialogs.c:432 msgid "Bad string" msgstr "Nieprawid³owe wyra¿enie" @@ -180,13 +180,13 @@ msgid "Empty string not allowed" msgstr "Musisz wpisaæ jakie¶ wyra¿enie" #. accelerator_context(do_auth_dialog, do_edit_dialog, input_dialog, menu_add_ext, resize_terminal_dialog, src/config/dialogs.c:build_edit_dialog, src/cookies/dialogs.c:build_edit_dialog, src/cookies/dialogs.c:push_add_server_button, src/protocol/bittorrent/dialogs.c:bittorrent_query_callback, src/scripting/lua/core.c:l_edit_bookmark_dialog, src/scripting/lua/core.c:l_xdialog, src/session/download.c:do_type_query, src/session/download.c:lookup_unique_name, src/viewer/text/search.c:search_dlg_do, terminal_options) -#: src/bfu/inpfield.c:256 src/config/dialogs.c:394 src/cookies/dialogs.c:357 -#: src/cookies/dialogs.c:455 src/dialogs/edit.c:102 src/dialogs/edit.c:105 -#: src/dialogs/options.c:237 src/dialogs/options.c:316 src/mime/dialogs.c:132 +#: src/bfu/inpfield.c:256 src/config/dialogs.c:366 src/cookies/dialogs.c:373 +#: src/cookies/dialogs.c:471 src/dialogs/edit.c:102 src/dialogs/edit.c:105 +#: src/dialogs/options.c:235 src/dialogs/options.c:314 src/mime/dialogs.c:132 #: src/protocol/auth/dialogs.c:116 src/protocol/bittorrent/dialogs.c:812 #: src/scripting/lua/core.c:391 src/scripting/lua/core.c:472 -#: src/session/download.c:637 src/session/download.c:1243 -#: src/viewer/text/search.c:1667 +#: src/session/download.c:644 src/session/download.c:1266 +#: src/viewer/text/search.c:1670 msgid "~Cancel" msgstr "~Anuluj" @@ -199,8 +199,8 @@ msgid "Digital clock in the status bar." msgstr "Cyfrowy zegar w pasku statusu." # -#: src/bfu/leds.c:77 src/bfu/leds.c:94 src/config/options.inc:1214 -#: src/config/options.inc:1221 src/ecmascript/ecmascript.c:45 +#: src/bfu/leds.c:77 src/bfu/leds.c:94 src/config/options.inc:1178 +#: src/config/options.inc:1185 src/ecmascript/ecmascript.c:45 #: src/globhist/globhist.c:64 src/mime/backend/mailcap.c:93 #: src/mime/backend/mimetypes.c:52 src/network/ssl/ssl.c:80 msgid "Enable" @@ -244,6 +244,7 @@ msgid "LED indicators" msgstr "Wska¼niki LED" #: src/bfu/leds.c:306 +#, c-format msgid "" "What the different LEDs indicate:\n" "\n" @@ -276,6 +277,7 @@ msgid "Search menu/" msgstr "Menu wyszukiwania/" #: src/bookmarks/backend/xbel.c:97 +#, c-format msgid "read_bookmarks_xbel(): Error in XML_ParserCreate()" msgstr "read_bookmarks_xbel(): B³±d w XML_ParserCreate()" @@ -337,7 +339,8 @@ msgid "" msgstr "" "Format pliku zak³adek (dotyczy i odczytu, i zapisu):\n" "0 - domy¶lny format ELinksa\n" -"1 - XBEL uniwersalny format XML (bug:153 BEZ OBS£UGI ZNAKÓW NARODOWYCH!) (WY£¡CZONE)" +"1 - XBEL uniwersalny format XML (bug:153 BEZ OBS£UGI ZNAKÓW NARODOWYCH!) " +"(WY£¡CZONE)" #: src/bookmarks/bookmarks.c:67 msgid "Save folder state" @@ -375,7 +378,7 @@ msgstr "" "\n" "Wymagana jest obs³uga zak³adek." -#: src/bookmarks/dialogs.c:72 src/config/options.inc:1066 +#: src/bookmarks/dialogs.c:72 src/config/options.inc:1030 #: src/dialogs/document.c:145 src/globhist/dialogs.c:65 msgid "Title" msgstr "Tytu³" @@ -485,22 +488,22 @@ msgid "~Goto" msgstr "~Przejd¼ do" #. accelerator_context(src/bookmarks/dialogs.c:bookmark_buttons, src/config/dialogs.c:option_buttons, src/cookies/dialogs.c:cookie_buttons) -#: src/bookmarks/dialogs.c:488 src/config/dialogs.c:531 -#: src/cookies/dialogs.c:476 +#: src/bookmarks/dialogs.c:488 src/config/dialogs.c:503 +#: src/cookies/dialogs.c:492 msgid "~Edit" msgstr "~Edytuj" #. accelerator_context(src/bookmarks/dialogs.c:bookmark_buttons, src/cache/dialogs.c:cache_buttons, src/config/dialogs.c:keybinding_buttons, src/config/dialogs.c:option_buttons, src/cookies/dialogs.c:cookie_buttons, src/dialogs/menu.c:ext_menu, src/formhist/dialogs.c:formhist_buttons, src/globhist/dialogs.c:globhist_buttons, src/protocol/auth/dialogs.c:auth_buttons) #: src/bookmarks/dialogs.c:489 src/cache/dialogs.c:231 -#: src/config/dialogs.c:533 src/config/dialogs.c:960 src/cookies/dialogs.c:477 -#: src/dialogs/menu.c:457 src/formhist/dialogs.c:211 +#: src/config/dialogs.c:505 src/config/dialogs.c:932 src/cookies/dialogs.c:493 +#: src/dialogs/menu.c:461 src/formhist/dialogs.c:211 #: src/globhist/dialogs.c:229 src/protocol/auth/dialogs.c:263 msgid "~Delete" msgstr "~Usuñ" #. accelerator_context(src/bookmarks/dialogs.c:bookmark_buttons, src/config/dialogs.c:keybinding_buttons, src/config/dialogs.c:option_buttons, src/cookies/dialogs.c:cookie_buttons, src/dialogs/menu.c:ext_menu) -#: src/bookmarks/dialogs.c:490 src/config/dialogs.c:532 -#: src/config/dialogs.c:959 src/cookies/dialogs.c:474 src/dialogs/menu.c:455 +#: src/bookmarks/dialogs.c:490 src/config/dialogs.c:504 +#: src/config/dialogs.c:931 src/cookies/dialogs.c:490 src/dialogs/menu.c:459 msgid "~Add" msgstr "~Dodaj" @@ -521,7 +524,7 @@ msgstr "Prze~nie #. accelerator_context(src/bookmarks/dialogs.c:bookmark_buttons, src/cache/dialogs.c:cache_buttons, src/config/dialogs.c:keybinding_buttons, src/config/dialogs.c:option_buttons, src/dialogs/menu.c:view_menu, src/globhist/dialogs.c:globhist_buttons) #: src/bookmarks/dialogs.c:494 src/cache/dialogs.c:232 -#: src/config/dialogs.c:534 src/config/dialogs.c:962 src/dialogs/menu.c:408 +#: src/config/dialogs.c:506 src/config/dialogs.c:934 src/dialogs/menu.c:412 #: src/globhist/dialogs.c:230 msgid "~Search" msgstr "~Szukaj" @@ -570,7 +573,7 @@ msgstr "URL proxy" msgid "Redirect" msgstr "Przekierowanie" -#: src/cache/dialogs.c:85 src/config/options.inc:518 +#: src/cache/dialogs.c:85 src/config/options.inc:519 #: src/dialogs/document.c:156 src/protocol/bittorrent/dialogs.c:126 msgid "Size" msgstr "Rozmiar" @@ -593,7 +596,7 @@ msgstr "Szyfr SSL" #: src/cache/dialogs.c:106 src/dialogs/document.c:188 msgid "Encoding" -msgstr "Kodowanie" +msgstr "Kompresja" #: src/cache/dialogs.c:112 msgid "Flags" @@ -608,7 +611,7 @@ msgid "invalid" msgstr "nieprawid³owy" #: src/cache/dialogs.c:125 src/cookies/dialogs.c:40 src/cookies/dialogs.c:44 -#: src/cookies/dialogs.c:353 +#: src/cookies/dialogs.c:369 msgid "Expires" msgstr "Wygasa" @@ -616,7 +619,7 @@ msgstr "Wygasa" msgid "ID" msgstr "ID" -#: src/cache/dialogs.c:134 src/config/options.inc:722 +#: src/cache/dialogs.c:134 src/config/options.inc:669 msgid "Header" msgstr "Nag³ówek" @@ -653,7 +656,7 @@ msgid "Delete this cache entry?" msgstr "Czy usun±æ zaznaczony wpis cache?" #. accelerator_context(display_download, src/cache/dialogs.c:cache_buttons, src/config/dialogs.c:option_buttons, src/cookies/dialogs.c:cookie_buttons, src/dialogs/download.c:download_buttons, src/formhist/dialogs.c:formhist_buttons, src/globhist/dialogs.c:globhist_buttons, src/protocol/auth/dialogs.c:auth_buttons) -#: src/cache/dialogs.c:229 src/config/dialogs.c:530 src/cookies/dialogs.c:473 +#: src/cache/dialogs.c:229 src/config/dialogs.c:502 src/cookies/dialogs.c:489 #: src/dialogs/download.c:255 src/dialogs/download.c:492 #: src/formhist/dialogs.c:210 src/globhist/dialogs.c:225 #: src/protocol/auth/dialogs.c:262 @@ -702,8 +705,8 @@ msgid "Copy text to clipboard" msgstr "Skopiuj tekst do schowka" #: src/config/actions-edit.inc:14 -msgid "Delete text from clipboard" -msgstr "Skasuj tekst w schowku" +msgid "Cut text to clipboard" +msgstr "Wytnij tekst do schowka" #: src/config/actions-edit.inc:15 src/config/actions-menu.inc:9 msgid "Delete character under cursor" @@ -1145,8 +1148,8 @@ msgstr "Prze msgid "Submit form and reload" msgstr "Prze¶lij formularz i prze³aduj" -#: src/config/actions-main.inc:101 src/terminal/tab.c:203 -#: src/terminal/tab.c:246 +#: src/config/actions-main.inc:101 src/terminal/tab.c:204 +#: src/terminal/tab.c:248 msgid "Close tab" msgstr "Zamknij kartê" @@ -1264,16 +1267,19 @@ msgstr "Zbyt wiele parametr msgid "error" msgstr "b³±d" -#: src/config/cmdline.c:164 src/network/state.c:47 +#: src/config/cmdline.c:164 src/network/state.c:48 +#, c-format msgid "Host not found" msgstr "Nie znaleziono serwera" # #: src/config/cmdline.c:178 +#, c-format msgid "Resolver error" msgstr "B³±d resolwera" -#: src/config/cmdline.c:255 src/config/dialogs.c:83 src/network/state.c:46 +#: src/config/cmdline.c:255 src/cookies/cookies.c:868 src/network/state.c:47 +#: src/util/secsave.c:373 msgid "Out of memory" msgstr "Brak pamiêci" @@ -1733,7 +1739,7 @@ msgstr "Wypisz informacje o wersji i zako msgid "Print ELinks version information and exit." msgstr "Wypisz informacje o wersji ELinksa i zakoñcz dzia³anie." -#: src/config/conf.c:720 +#: src/config/conf.c:722 msgid "" "## This is ELinks configuration file. You can edit it manually,\n" "## if you wish so; this file is edited by ELinks when you save\n" @@ -1746,7 +1752,7 @@ msgstr "" "## tylko warto¶ci opcji bêd± zmienione a formatowanie, komentarze\n" "## itp. pozostan± niezmienione.\n" -#: src/config/conf.c:728 +#: src/config/conf.c:730 msgid "" "## This is ELinks configuration file. You can edit it manually,\n" "## if you wish so; this file is edited by ELinks when you save\n" @@ -1765,7 +1771,7 @@ msgstr "" "## traktowana jako brakuj±ca. Wiedz, ¿e sposób formatowania\n" "## i komentarze pozostan± niezmienione.\n" -#: src/config/conf.c:738 +#: src/config/conf.c:740 msgid "" "## This is ELinks configuration file. You can edit it manually,\n" "## if you wish so, but keep in mind that this file is overwritten\n" @@ -1777,7 +1783,7 @@ msgstr "" "## przez ELinksa gdy zapiszesz konfiguracjê poprzez menad¿era ustawieñ\n" "## Twoje formatowanie i komentarze zostan± utracone.\n" -#: src/config/conf.c:749 +#: src/config/conf.c:751 msgid "" "## Obviously, if you don't like what ELinks is going to do with\n" "## this file, you can change it by altering the config.saving_style\n" @@ -1786,65 +1792,33 @@ msgstr "" "## Oczywi¶cie, je¶li nie podoba Ci siê to, co ELinks robi z tym plikiem\n" "## mo¿esz to zmieniæ ustawiaj±c odpowiednio zmienn± config.saving_style.\n" -#: src/config/conf.c:762 +#: src/config/conf.c:764 msgid "Automatically saved options\n" msgstr "Automatycznie zapisane ustawienia\n" -#: src/config/conf.c:774 +#: src/config/conf.c:776 msgid "Automatically saved keybindings\n" msgstr "Automatycznie zapisane przypisania klawiszy\n" -#: src/config/dialogs.c:54 +#: src/config/dialogs.c:53 msgid "Write config success" msgstr "Zapisano konfiguracjê" -#: src/config/dialogs.c:55 +#: src/config/dialogs.c:54 #, c-format msgid "Options were saved successfully to config file %s." msgstr "Ustawienia zosta³y zapisane pomy¶lnie do pliku konfiguracyjnego %s." #. accelerator_context(write_config_dialog) -#: src/config/dialogs.c:59 +#: src/config/dialogs.c:58 msgid "~Do not show anymore" msgstr "~Nie pokazuj wiêcej" -#: src/config/dialogs.c:65 -msgid "Cannot read the file" -msgstr "B³±d odczytu z pliku" - -#: src/config/dialogs.c:68 -msgid "Cannot get file status" -msgstr "Nie mo¿na otrzymaæ statusu pliku" - -#: src/config/dialogs.c:71 -msgid "Cannot access the file" -msgstr "B³±d dostêpu do pliku" - -#: src/config/dialogs.c:74 -msgid "Cannot create temp file" -msgstr "B³±d przy tworzeniu pliku tymczasowego" - -#: src/config/dialogs.c:77 -msgid "Cannot rename the file" -msgstr "B³±d przy zmianie nazwy pliku" - -#: src/config/dialogs.c:80 -msgid "File saving disabled by option" -msgstr "Zapis pliku zablokowany przez opcjê" - -#: src/config/dialogs.c:86 -msgid "Cannot write the file" -msgstr "B³±d zapisu do pliku" - -#: src/config/dialogs.c:91 -msgid "Secure file saving error" -msgstr "B³±d przy bezpiecznym zapisie pliku" - -#: src/config/dialogs.c:99 +#: src/config/dialogs.c:69 msgid "Write config error" msgstr "B³±d przy zapisie konfiguracji" -#: src/config/dialogs.c:100 +#: src/config/dialogs.c:70 #, c-format msgid "" "Unable to write to config file %s.\n" @@ -1853,25 +1827,25 @@ msgstr "" "Nie mo¿na zapisaæ do pliku konfiguracyjnego %s.\n" "%s" -#: src/config/dialogs.c:155 +#: src/config/dialogs.c:125 msgid "modified" msgstr "zmodyfikowany" -#: src/config/dialogs.c:174 +#: src/config/dialogs.c:145 msgid "(expand by pressing space)" msgstr "(rozwiñ przyciskaj±c spacjê)" -#: src/config/dialogs.c:177 src/config/dialogs.c:360 -#: src/config/options.inc:872 +#: src/config/dialogs.c:149 src/config/dialogs.c:330 +#: src/config/options.inc:819 msgid "Type" msgstr "Typ" -#: src/config/dialogs.c:202 src/config/dialogs.c:389 src/cookies/dialogs.c:35 -#: src/cookies/dialogs.c:351 +#: src/config/dialogs.c:174 src/config/dialogs.c:361 src/cookies/dialogs.c:35 +#: src/cookies/dialogs.c:367 msgid "Value" msgstr "Warto¶æ" -#: src/config/dialogs.c:206 +#: src/config/dialogs.c:178 msgid "" "\n" "\n" @@ -1881,30 +1855,30 @@ msgstr "" "\n" "Ta warto¶æ uleg³a zmianie od momentu ostatniego zapisu konfiguracji." -#: src/config/dialogs.c:212 src/config/dialogs.c:364 +#: src/config/dialogs.c:184 src/config/dialogs.c:335 msgid "N/A" msgstr "Brak" -#: src/config/dialogs.c:214 src/config/dialogs.c:362 +#: src/config/dialogs.c:186 src/config/dialogs.c:333 msgid "Description" msgstr "Opis" -#: src/config/dialogs.c:321 src/protocol/bittorrent/dialogs.c:599 -#: src/protocol/protocol.c:230 src/session/session.c:290 -#: src/session/session.c:975 src/viewer/text/textarea.c:571 -#: src/viewer/text/textarea.c:578 +#: src/config/dialogs.c:291 src/protocol/bittorrent/dialogs.c:599 +#: src/protocol/protocol.c:230 src/session/session.c:285 +#: src/session/session.c:970 src/viewer/text/textarea.c:590 +#: src/viewer/text/textarea.c:597 msgid "Error" msgstr "B³±d" -#: src/config/dialogs.c:322 +#: src/config/dialogs.c:292 msgid "Bad option value." msgstr "Niepoprawna warto¶æ." -#: src/config/dialogs.c:350 src/config/dialogs.c:418 src/cookies/dialogs.c:323 +#: src/config/dialogs.c:320 src/config/dialogs.c:390 src/cookies/dialogs.c:337 msgid "Edit" msgstr "Edytuj" -#: src/config/dialogs.c:419 +#: src/config/dialogs.c:391 msgid "" "This option cannot be edited. This means that this is some special option " "like a folder - try to press a space in order to see its contents." @@ -1912,7 +1886,7 @@ msgstr "" "To nie jest edytowalna opcja, ale co¶ podobnego do folderu. Naci¶nij spacjê, " "a zobaczysz zawarto¶æ." -#: src/config/dialogs.c:461 +#: src/config/dialogs.c:433 msgid "" "Option names may only contain alpha-numeric characters\n" "in addition to '_' and '-'." @@ -1920,42 +1894,42 @@ msgstr "" "Nazwy opcji mog± zawieraæ tylko znaki alfanumeryczne\n" "oraz '_' i '-'." -#: src/config/dialogs.c:482 src/config/dialogs.c:507 +#: src/config/dialogs.c:454 src/config/dialogs.c:479 msgid "Add option" msgstr "Dodaj opcjê" -#: src/config/dialogs.c:483 +#: src/config/dialogs.c:455 msgid "Cannot add an option here." msgstr "Nie mo¿na dodaæ tu opcji." #. accelerator_context(src/config/dialogs.c:keybinding_buttons, src/config/dialogs.c:option_buttons, src/cookies/dialogs.c:cookie_buttons, src/formhist/dialogs.c:formhist_buttons, src/protocol/bittorrent/dialogs.c:bittorrent_query_callback, src/session/download.c:do_type_query, terminal_options) -#: src/config/dialogs.c:535 src/config/dialogs.c:963 src/cookies/dialogs.c:479 -#: src/dialogs/options.c:236 src/formhist/dialogs.c:214 -#: src/protocol/bittorrent/dialogs.c:799 src/session/download.c:1227 +#: src/config/dialogs.c:507 src/config/dialogs.c:935 src/cookies/dialogs.c:495 +#: src/dialogs/options.c:234 src/formhist/dialogs.c:214 +#: src/protocol/bittorrent/dialogs.c:799 src/session/download.c:1250 msgid "Sa~ve" msgstr "~Zapisz" -#: src/config/dialogs.c:540 +#: src/config/dialogs.c:512 msgid "Option manager" msgstr "Menad¿er ustawieñ" -#: src/config/dialogs.c:702 +#: src/config/dialogs.c:674 msgid "Keystroke" msgstr "Skrót klawiszowy" -#: src/config/dialogs.c:704 src/config/options.inc:1234 +#: src/config/dialogs.c:676 src/config/options.inc:1198 msgid "Action" msgstr "Akcja" -#: src/config/dialogs.c:705 +#: src/config/dialogs.c:677 msgid "Keymap" msgstr "Mapowanie klawiatury" -#: src/config/dialogs.c:844 +#: src/config/dialogs.c:816 msgid "Keystroke already used" msgstr "Skrót klawiszowy jest ju¿ u¿ywany" -#: src/config/dialogs.c:845 +#: src/config/dialogs.c:817 #, c-format msgid "" "The keystroke \"%s\" is currently used for \"%s\".\n" @@ -1964,19 +1938,19 @@ msgstr "" "Skrót klawiszowy \"%s\" jest u¿ywany przez \"%s\".\n" "Czy na pewno chcesz go zmieniæ?" -#: src/config/dialogs.c:870 src/config/dialogs.c:887 src/config/dialogs.c:923 +#: src/config/dialogs.c:842 src/config/dialogs.c:859 src/config/dialogs.c:895 msgid "Add keybinding" msgstr "Dodaj przypisanie" -#: src/config/dialogs.c:871 +#: src/config/dialogs.c:843 msgid "Invalid keystroke." msgstr "Niepoprawny skrót klawiszowy." -#: src/config/dialogs.c:888 +#: src/config/dialogs.c:860 msgid "Need to select an action." msgstr "Trzeba wybraæ akcjê." -#: src/config/dialogs.c:910 +#: src/config/dialogs.c:882 #, c-format msgid "" "Action: %s\n" @@ -1998,15 +1972,15 @@ msgstr "" "Skrót klawiszowy" #. accelerator_context(menu_keys, src/config/dialogs.c:keybinding_buttons, src/globhist/dialogs.c:globhist_buttons) -#: src/config/dialogs.c:961 src/dialogs/info.c:135 src/globhist/dialogs.c:231 +#: src/config/dialogs.c:933 src/dialogs/info.c:135 src/globhist/dialogs.c:231 msgid "~Toggle display" msgstr "~Krótki/d³ugi opis" -#: src/config/dialogs.c:968 +#: src/config/dialogs.c:940 msgid "Keybinding manager" msgstr "Menad¿er przypisañ klawiszy" -#: src/config/home.c:121 +#: src/config/home.c:122 #, c-format msgid "" "Commandline options -config-dir set to %s, but could not create directory %s." @@ -2014,12 +1988,13 @@ msgstr "" "Opcja linii poleceñ -config-dir ustawiona na %s, ale nie mo¿na utworzyæ\n" "katalogu %s." -#: src/config/home.c:126 +#: src/config/home.c:127 #, c-format msgid "ELINKS_CONFDIR set to %s, but could not create directory %s." msgstr "ELINKS_CONFDIR ustawione na %s, ale nie mo¿na utworzyæ katalogu %s." -#: src/config/home.c:149 +#: src/config/home.c:150 +#, c-format msgid "" "Unable to find or create ELinks config directory. Please check if you have " "$HOME variable set correctly and if you have write permission to your home " @@ -2057,6 +2032,11 @@ msgstr "Nierozpoznana akcja (b msgid "Error registering event" msgstr "B³±d przy rejestrowaniu zdarzenia" +#. name: +#: src/config/kbdbind.c:992 +msgid "Keyboard Bindings" +msgstr "Przypisania klawiszy" + #. #: src/config/options.inc:19 msgid "Configuration system" @@ -2218,7 +2198,7 @@ msgstr "" "Ilo¶æ prób nawi±zania po³±czenia.\n" "Zero oznacza nie poddawaj siê." -#: src/config/options.inc:93 src/network/state.c:52 +#: src/config/options.inc:93 src/network/state.c:53 msgid "Receive timeout" msgstr "Limit czasu pobierania" @@ -2287,7 +2267,8 @@ msgstr "" # #. Keep options in alphabetical order. -#: src/config/options.inc:134 +#. name: +#: src/config/options.inc:134 src/document/document.c:346 msgid "Document" msgstr "Dokument" @@ -2586,14 +2567,14 @@ msgid "Active link colors." msgstr "Kolory aktywnego odno¶nika." # -#: src/config/options.inc:274 src/config/options.inc:548 -#: src/config/options.inc:960 +#: src/config/options.inc:274 src/config/options.inc:549 +#: src/config/options.inc:924 msgid "Background color" msgstr "Kolor t³a" # -#: src/config/options.inc:276 src/config/options.inc:550 -#: src/config/options.inc:961 +#: src/config/options.inc:276 src/config/options.inc:551 +#: src/config/options.inc:925 msgid "Default background color." msgstr "Domy¶lny kolor t³a." @@ -2606,13 +2587,13 @@ msgstr "Domy #. * on it. #. The colors and mono tree should be similar but with different default #. * values of course so always use the macros below. -#: src/config/options.inc:278 src/config/options.inc:544 -#: src/config/options.inc:958 +#: src/config/options.inc:278 src/config/options.inc:545 +#: src/config/options.inc:922 msgid "Text color" msgstr "Kolor tekstu" -#: src/config/options.inc:280 src/config/options.inc:546 -#: src/config/options.inc:959 +#: src/config/options.inc:280 src/config/options.inc:547 +#: src/config/options.inc:923 msgid "Default text color." msgstr "Domy¶lny kolor tekstu." @@ -2646,8 +2627,8 @@ msgstr "Inwersja kolor msgid "Invert the fore- and background color so the link stands out." msgstr "Odwróæ kolory tekstu i t³a tak, ¿eby wyró¿niæ odno¶nik." -#: src/config/options.inc:296 src/config/options.inc:923 -#: src/dialogs/options.c:231 +#: src/config/options.inc:296 src/config/options.inc:887 +#: src/dialogs/options.c:229 msgid "Underline" msgstr "Podkre¶lenie" @@ -3099,45 +3080,51 @@ msgstr "Przedzia #: src/config/options.inc:508 msgid "" -"Period that a cache entry is considered to be up-to-date.\n" -"When a document is loaded and this interval has elapsed since the\n" -"document was initially loaded or most recently revalidated\n" -"with the server, the server will be checked in case there is\n" -"a more up-to-date version of the document." +"Period in seconds that a cache entry is considered to be\n" +"up-to-date. When a document is loaded and this interval has elapsed\n" +"since the document was initially loaded or most recently\n" +"revalidated with the server, the server will be checked in case\n" +"there is a more up-to-date version of the document.\n" +"\n" +"A value of -1 disables automatic revalidation." msgstr "" -"Okres, przez który dokument jest uwa¿any za aktualny.\n" -"Gdy dokument jest za³adowany i minie dany czas od pierwszego\n" -"za³adowania lub ostatniej aktualizacji dokumentu z serwera,\n" -"wysy³ane jest zapytanie do serwera o najnowsz± wersjê dokumentu." +"Okres w sekundach, przez który dokument w pamiêci podrêcznej\n" +"jest uwa¿any za aktualny. Gdy wczytywany dokument by³ ju¿ wcze¶niej\n" +"w pamiêci podrêcznej i nie min±³ dany okres, to zostanie on u¿yty\n" +"(ten z pamiêci podrêcznej). W przypadku up³ywu danego czasu ELinks\n" +"sprawdza czy nie ma nowszej wersji na serwerze.\n" +"\n" +"Warto¶æ -1 wy³±cza to sprawdzanie. Wtedy u¿yty bêdzie dokument\n" +"z pamiêci podrêcznej." -#: src/config/options.inc:514 src/dialogs/info.c:201 +#: src/config/options.inc:515 src/dialogs/info.c:201 msgid "Memory cache" msgstr "Pamiêæ podrêczna" # -#: src/config/options.inc:516 +#: src/config/options.inc:517 msgid "Memory cache options." msgstr "Ustawienia pamiêci podrêcznej." -#: src/config/options.inc:520 +#: src/config/options.inc:521 msgid "Memory cache size (in bytes)." msgstr "Rozmiar pamiêci podrêcznej (w bajtach)." # -#: src/config/options.inc:524 +#: src/config/options.inc:525 msgid "Charset" msgstr "Zestaw znaków" # -#: src/config/options.inc:526 +#: src/config/options.inc:527 msgid "Charset options." msgstr "Ustawienia dotycz±ce zestawu znaków." -#: src/config/options.inc:528 +#: src/config/options.inc:529 msgid "Default codepage" msgstr "Domy¶lna strona kodowa" -#: src/config/options.inc:530 +#: src/config/options.inc:531 msgid "" "Default document codepage. 'System' stands for\n" "a codepage determined by a selected locale." @@ -3145,60 +3132,60 @@ msgstr "" "Domy¶lna strona kodowa dokumentu. 'System' oznacza,\n" "¿e strona kodowa bêdzie okre¶lana na podstawie locale." -#: src/config/options.inc:533 +#: src/config/options.inc:534 msgid "Ignore charset info from server" msgstr "Ignoruj informacje o stronie kodowej z serwera" -#: src/config/options.inc:535 +#: src/config/options.inc:536 msgid "Ignore charset info sent by server." msgstr "Ignoruj informacje o stronie kodowej wysy³ane przez serwer." -#: src/config/options.inc:539 +#: src/config/options.inc:540 msgid "Default color settings" msgstr "Domy¶lne ustawienia kolorów" -#: src/config/options.inc:541 +#: src/config/options.inc:542 msgid "Default document color settings." msgstr "Domy¶lne ustawienia kolorów dokumentu." # -#: src/config/options.inc:552 +#: src/config/options.inc:553 msgid "Link color" msgstr "Kolor odno¶nika" -#: src/config/options.inc:554 +#: src/config/options.inc:555 msgid "Default link color." msgstr "Domy¶lny kolor odno¶nika." -#: src/config/options.inc:556 +#: src/config/options.inc:557 msgid "Visited-link color" msgstr "Kolor odwiedzonego odno¶nika" -#: src/config/options.inc:558 +#: src/config/options.inc:559 msgid "Default visited link color." msgstr "Domy¶lny kolor odwiedzonego odno¶nika." -#: src/config/options.inc:560 +#: src/config/options.inc:561 msgid "Image-link color" msgstr "Kolor odno¶nika w obrazku" -#: src/config/options.inc:562 +#: src/config/options.inc:563 msgid "Default image link color." msgstr "Domy¶lny kolor odno¶nika w obrazku." -#: src/config/options.inc:564 +#: src/config/options.inc:565 msgid "Bookmarked-link color" msgstr "Kolor odno¶nika bêd±cego w zak³adce" -#: src/config/options.inc:566 +#: src/config/options.inc:567 msgid "Default bookmarked link color." msgstr "Domy¶lny kolor odno¶nika bêd±cego w zak³adce." -#: src/config/options.inc:568 +#: src/config/options.inc:569 msgid "Directory color" msgstr "Kolor katalogów" -#: src/config/options.inc:570 +#: src/config/options.inc:571 msgid "" "Default directory color.\n" "See document.browse.links.color_dirs option." @@ -3206,11 +3193,11 @@ msgstr "" "Domy¶lny kolor katalogów.\n" "Zobacz opcjê document.browse.links.color_dirs ." -#: src/config/options.inc:577 +#: src/config/options.inc:578 msgid "Increase contrast" msgstr "Zwiêkszenie kontrastu" -#: src/config/options.inc:579 +#: src/config/options.inc:580 msgid "" "Increase the contrast between the foreground and background colors\n" "to ensure readability. For example it disallows dark colors on a\n" @@ -3222,21 +3209,21 @@ msgstr "" "kolory na czarnym tle. Uwaga, ta opcja ró¿ni siê od zapewnienia\n" "kontrastu opcj± ensure_contrast." -#: src/config/options.inc:584 +#: src/config/options.inc:585 msgid "Ensure contrast" msgstr "Gwarancja kontrastu" -#: src/config/options.inc:586 +#: src/config/options.inc:587 msgid "Makes sure that the back- and foreground color are never equal." msgstr "Zapewnia, ¿e kolor t³a i pierwszoplanowy nigdy nie s± identyczne." #. If you change this please also change ACT_MAIN_DOCUMENT_COLORS action #. * handling. -#: src/config/options.inc:591 +#: src/config/options.inc:592 msgid "Use document-specified colors" msgstr "U¿ycie kolorów podanych w dokumencie" -#: src/config/options.inc:593 +#: src/config/options.inc:594 msgid "" "Use colors specified in document:\n" "0 is use always the default settings\n" @@ -3259,28 +3246,28 @@ msgstr "" # #. Keep options in alphabetical order. -#: src/config/options.inc:606 +#: src/config/options.inc:607 msgid "Downloading" msgstr "Pobieranie" -#: src/config/options.inc:608 +#: src/config/options.inc:609 msgid "Options regarding files downloading and handling." msgstr "Ustawienia dotycz±ce pobierania plików." # -#: src/config/options.inc:610 +#: src/config/options.inc:611 msgid "Default download directory" msgstr "Domy¶lny katalog dla pobieranych plików" -#: src/config/options.inc:612 +#: src/config/options.inc:613 msgid "Default download directory." msgstr "Domy¶lny katalog dla pobieranych plików." -#: src/config/options.inc:614 +#: src/config/options.inc:615 msgid "Set original time" msgstr "Ustaw oryginalny czas" -#: src/config/options.inc:616 +#: src/config/options.inc:617 msgid "" "Set the timestamp of each downloaded file to the timestamp\n" "stored on the server." @@ -3289,11 +3276,11 @@ msgstr "" "na serwerze." #. Does automatic resuming make sense as an option? -#: src/config/options.inc:620 +#: src/config/options.inc:621 msgid "Prevent overwriting" msgstr "Zapobieganie nadpisywaniu" -#: src/config/options.inc:622 +#: src/config/options.inc:623 msgid "" "Prevent overwriting the local files:\n" "0 is files will silently be overwritten\n" @@ -3306,11 +3293,11 @@ msgstr "" "2 - zapytaj u¿ytkownika" # -#: src/config/options.inc:627 +#: src/config/options.inc:628 msgid "Notify download completion by bell" msgstr "Informuj o zakoñczeniu pobierania dzwonkiem" -#: src/config/options.inc:629 +#: src/config/options.inc:630 msgid "" "Audio notification when download is completed:\n" "0 is never\n" @@ -3322,20 +3309,20 @@ msgstr "" "1 - gdy powiadamianie w tle jest w³±czone.\n" "2 - zawsze" -#: src/config/options.inc:635 +#: src/config/options.inc:636 msgid "Dump output" msgstr "Zrzuty" -#: src/config/options.inc:637 +#: src/config/options.inc:638 msgid "Dump output options." msgstr "Ustawienia dotycz±ce zrzutów." -#: src/config/options.inc:639 src/config/options.inc:927 +#: src/config/options.inc:640 src/config/options.inc:891 #: src/config/opttypes.c:408 src/dialogs/document.c:163 msgid "Codepage" msgstr "Strona kodowa" -#: src/config/options.inc:641 +#: src/config/options.inc:642 msgid "" "Codepage used in dump output. 'System' stands for\n" "a codepage determined by a selected locale." @@ -3343,73 +3330,22 @@ msgstr "" "Strona kodowa u¿yta podczas zrzutu. 'System' oznacza\n" "i¿ zostanie okre¶lona przez wybrane locale." -#: src/config/options.inc:650 src/config/options.inc:659 -#: src/config/options.inc:667 src/config/options.inc:675 -#: src/config/options.inc:682 src/config/options.inc:692 -#: src/config/options.inc:701 src/config/options.inc:710 -#: src/config/options.inc:904 +#: src/config/options.inc:645 src/config/options.inc:857 msgid "Color mode" msgstr "Tryb kolorowy" +#. The list of modes must be at the end of this string +#. * because AsciiDoc 7.1.2 does not support continuing +#. * an outer list entry after an inner list. +#. * TRANSLATORS: This restriction applies only to the +#. * "en" (English) translation. (See doc/Makefile.) #: src/config/options.inc:652 msgid "" -"Color mode for dumps:\n" -"-1 is standard dump mode\n" -"0 is mono mode\n" -"1 is 16 color mode\n" -"2 is 88 color mode\n" -"3 is 256 color mode" -msgstr "" -"Tryb koloru dla zrzutów:\n" -"-1 - tryb standardowy\n" -" 0 - tryb monochromatyczny\n" -" 1 - tryb 16-kolorowy\n" -" 2 - tryb 88-kolorowy\n" -" 3 - tryb 256-kolorowy" - -#: src/config/options.inc:661 -msgid "" -"Color mode for dumps:\n" -"-1 is standard dump mode\n" -"0 is mono mode\n" -"1 is 16 color mode\n" -"2 is 88 color mode" -msgstr "" -"Tryb koloru dla zrzutów:\n" -"-1 - tryb standardowy\n" -" 0 - tryb monochromatyczny\n" -" 1 - tryb 16-kolorowy\n" -" 2 - tryb 88-kolorowy" - -#: src/config/options.inc:669 -msgid "" -"Color mode for dumps:\n" -"-1 is standard dump mode\n" -"0 is mono mode\n" -"1 is 16 color mode\n" -"2 is 256 color mode" -msgstr "" -"Tryb koloru dla zrzutów:\n" -"-1 - tryb standardowy\n" -" 0 - tryb monochromatyczny\n" -" 1 - tryb 16-kolorowy\n" -" 2 - tryb 256-kolorowy" - -#: src/config/options.inc:677 -msgid "" -"Color mode for dumps:\n" -"-1 is standard dump mode\n" -"0 is mono mode\n" -"1 is 16 color mode" -msgstr "" -"Tryb koloru dla zrzutów:\n" -"-1 - tryb standardowy\n" -" 0 - tryb monochromatyczny\n" -" 1 - tryb 16-kolorowy" - -#: src/config/options.inc:684 -msgid "" -"Color mode for dumps:\n" +"Color mode for dumps.\n" +"Some modes may have been disabled at compile time. The Setup -> Terminal " +"options dialog lists the modes supported by this executable. If you select " +"an unsupported mode, ELinks uses 16 colors.\n" +"The color modes are:\n" "-1 is standard dump mode\n" "0 is mono mode\n" "1 is 16 color mode\n" @@ -3417,88 +3353,46 @@ msgid "" "3 is 256 color mode\n" "4 is true color mode" msgstr "" -"Tryb koloru dla zrzutów:\n" +"Tryby kolorów dla zrzutów.\n" +"Niektóre z tych trybów mog± byæ wy³±czone przy kompilacji. Lista dostêpnych " +"trybów jest widoczna poprzez Ustawienia -> Opcje terminala. Je¶li wybierzesz " +"nieobs³ugiwany tryb, ELinks u¿yje trybu 16 kolorów.\n" +"Tryby kolorowe to:\n" "-1 - tryb standardowy\n" " 0 - tryb monochromatyczny\n" -" 1 - tryb 16-kolorowy\n" -" 2 - tryb 88-kolorowy\n" -" 3 - tryb 256-kolorowy\n" -" 4 - tryb koloru 24-bitowy" +" 1 - 16 kolorów\n" +" 2 - 88 kolorów\n" +" 3 - 256 kolorów\n" +" 4 - kolor 24-bitowy" -#: src/config/options.inc:694 -msgid "" -"Color mode for dumps:\n" -"-1 is standard dump mode\n" -"0 is mono mode\n" -"1 is 16 color mode\n" -"2 is 88 color mode\n" -"3 is true color mode" -msgstr "" -"Tryb koloru dla zrzutów:\n" -"-1 - tryb standardowy\n" -" 0 - tryb monochromatyczny\n" -" 1 - tryb 16-kolorowy\n" -" 2 - tryb 88-kolorowy\n" -" 3 - tryb koloru 24-bitowy" - -#: src/config/options.inc:703 -msgid "" -"Color mode for dumps:\n" -"-1 is standard dump mode\n" -"0 is mono mode\n" -"1 is 16 color mode\n" -"2 is 256 color mode\n" -"3 is true color mode" -msgstr "" -"Tryb koloru dla zrzutów:\n" -"-1 - tryb standardowy\n" -" 0 - tryb monochromatyczny\n" -" 1 - tryb 16-kolorowy\n" -" 2 - tryb 88-kolorowy\n" -" 3 - tryb koloru 24-bitowy" - -#: src/config/options.inc:712 -msgid "" -"Color mode for dumps:\n" -"-1 is standard dump mode\n" -"0 is mono mode\n" -"1 is 16 color mode\n" -"2 is true color mode" -msgstr "" -"Tryb koloru dla zrzutów:\n" -"-1 - tryb standardowy\n" -" 0 - tryb monochromatyczny\n" -" 1 - tryb 16-kolorowy\n" -" 2 - tryb koloru 24-bitowy" - -#: src/config/options.inc:718 +#: src/config/options.inc:665 msgid "Footer" msgstr "Stopka" -#: src/config/options.inc:720 +#: src/config/options.inc:667 #, c-format msgid "Footer string used in dumps. %u is substituted by URL." msgstr "£añcuch stopki u¿ywany przy zrzutach. %u jest zastêpowane przez URL." -#: src/config/options.inc:724 +#: src/config/options.inc:671 #, c-format msgid "Header string used in dumps. %u is substituted by URL." msgstr "£añcuch nag³ówka u¿ywany przy zrzutach. %u jest zastêpowane przez URL." # -#: src/config/options.inc:726 +#: src/config/options.inc:673 msgid "Numbering" msgstr "Numerowanie" -#: src/config/options.inc:728 +#: src/config/options.inc:675 msgid "Whether to print link numbers in dump output." msgstr "Czy wypisywaæ numery odno¶ników przy zrzutach." -#: src/config/options.inc:730 +#: src/config/options.inc:677 msgid "References" msgstr "Referencje" -#: src/config/options.inc:732 +#: src/config/options.inc:679 msgid "" "Whether to print references (URIs) of document links\n" "in dump output." @@ -3506,92 +3400,92 @@ msgstr "" "Czy wypisywaæ referencje (URI) odno¶ników dokumentu\n" "przy zrzutach." -#: src/config/options.inc:735 +#: src/config/options.inc:682 msgid "Separator" msgstr "Separator" -#: src/config/options.inc:737 +#: src/config/options.inc:684 msgid "String which separates two dumps." msgstr "£añcuch, który rozdziela dwa zrzuty." -#: src/config/options.inc:739 +#: src/config/options.inc:686 msgid "Width" msgstr "Szeroko¶æ" -#: src/config/options.inc:741 +#: src/config/options.inc:688 msgid "Width of screen in characters when dumping documents." msgstr "Szeroko¶æ ekranu w znakach przy zrzutach dokumentów." # -#: src/config/options.inc:745 +#: src/config/options.inc:692 msgid "History" msgstr "Historia" -#: src/config/options.inc:747 +#: src/config/options.inc:694 msgid "History options." msgstr "Ustawienia dotycz±ce historii." # -#: src/config/options.inc:749 +#: src/config/options.inc:696 msgid "Keep unhistory" msgstr "Zapamiêtuj historiê powrotów" -#: src/config/options.inc:751 +#: src/config/options.inc:698 msgid "Keep unhistory (\"forward history\")." msgstr "Czy pamiêtaæ historiê powrotów." # -#: src/config/options.inc:754 +#: src/config/options.inc:701 msgid "HTML rendering" msgstr "Formatowanie HTML-a" -#: src/config/options.inc:756 +#: src/config/options.inc:703 msgid "Options concerning the display of HTML pages." msgstr "Ustawienia dotycz±ce wy¶wietlania stron HTML." # -#: src/config/options.inc:758 +#: src/config/options.inc:705 msgid "Display frames" msgstr "Wy¶wietlanie ramek" # -#: src/config/options.inc:760 +#: src/config/options.inc:707 msgid "Display frames." msgstr "Wy¶wietlaj ramki." # -#: src/config/options.inc:762 +#: src/config/options.inc:709 msgid "Display tables" msgstr "Wy¶wietlanie tabel" # -#: src/config/options.inc:764 +#: src/config/options.inc:711 msgid "Display tables." msgstr "Wy¶wietlaj tabele." # -#: src/config/options.inc:766 +#: src/config/options.inc:713 msgid "Display subscripts" msgstr "Wy¶wietlanie indeksów dolnych" -#: src/config/options.inc:768 +#: src/config/options.inc:715 msgid "Display subscripts (as [thing])." msgstr "Pokazuj indeks dolny (jako [co¶])." # -#: src/config/options.inc:770 +#: src/config/options.inc:717 msgid "Display superscripts" msgstr "Wy¶wietlanie indeksów górnych" -#: src/config/options.inc:772 +#: src/config/options.inc:719 msgid "Display superscripts (as ^thing)." msgstr "Pokazuj indeks górny (jako ^co¶)." -#: src/config/options.inc:774 +#: src/config/options.inc:721 msgid "Rendering of html link element" msgstr "Wy¶wietlanie elementu odno¶nika html" -#: src/config/options.inc:776 +#: src/config/options.inc:723 msgid "" "How to render tags from the HTML header:\n" "0 is nothing\n" @@ -3609,19 +3503,19 @@ msgstr "" "4 - dodatkowo typ\n" "5 - wszystko" -#: src/config/options.inc:784 +#: src/config/options.inc:731 msgid "Underline links" msgstr "Podkre¶lanie odno¶ników" -#: src/config/options.inc:786 +#: src/config/options.inc:733 msgid "Underline links." msgstr "Podkre¶laj odno¶niki." -#: src/config/options.inc:788 +#: src/config/options.inc:735 msgid "Wrap non breaking space" msgstr "Zawijanie nie ³ami±cych spacji" -#: src/config/options.inc:790 +#: src/config/options.inc:737 msgid "" "If set do not honour non breaking space (the nbsp entity)\n" "but allow to wrap the text. This can help keeping the width\n" @@ -3632,37 +3526,37 @@ msgstr "" "szeroko¶æ dokumentów tak, ¿eby nie by³o potrzebne przewijanie w poziomie." # -#: src/config/options.inc:795 +#: src/config/options.inc:742 msgid "Plain rendering" msgstr "Formatowanie zwyk³ego tekstu" -#: src/config/options.inc:797 +#: src/config/options.inc:744 msgid "Options concerning the display of plain text pages." msgstr "Ustawienia dotycz±ce wy¶wietlania zwyk³ego tekstu." -#: src/config/options.inc:799 +#: src/config/options.inc:746 msgid "Display URIs" msgstr "Wy¶wietlanie URI" -#: src/config/options.inc:801 +#: src/config/options.inc:748 msgid "Display URIs in the document as links." msgstr "Wy¶wietlanie URI w dokumencie jako odno¶ników." -#: src/config/options.inc:803 +#: src/config/options.inc:750 msgid "Compress empty lines" msgstr "Usuwanie pustych linii" -#: src/config/options.inc:805 +#: src/config/options.inc:752 msgid "Compress successive empty lines to only one in displayed text." msgstr "" "Usuwaj nastêpne puste linie, tak ¿eby tylko jedna pusta linia by³a " "wy¶wietlana." -#: src/config/options.inc:808 +#: src/config/options.inc:755 msgid "URI passing" msgstr "Przekazywanie URI" -#: src/config/options.inc:810 +#: src/config/options.inc:757 msgid "" "Rules for passing URIs to external commands. When one rule\n" "is defined the link and tab menu will have a menu item that\n" @@ -3686,7 +3580,7 @@ msgstr "" "przez dowi±zanie akcji do klawiatury dla frame-external-command,\n" "link-external-command i tab-external-command." -#: src/config/options.inc:823 +#: src/config/options.inc:770 msgid "" "A rule for passing URI to an external command.\n" "The format is:\n" @@ -3701,19 +3595,19 @@ msgstr "" "Nie dodawaj apostrofów lub cudzys³owów wokó³ %c." #. Keep options in alphabetical order. -#: src/config/options.inc:833 +#: src/config/options.inc:780 msgid "Information files" msgstr "Pliki informacyjne" -#: src/config/options.inc:835 +#: src/config/options.inc:782 msgid "Options for information files in ~/.elinks." msgstr "Ustawienia plików informacyjnych w ~/.elinks." -#: src/config/options.inc:837 +#: src/config/options.inc:784 msgid "Save interval" msgstr "Przedzia³ czasu pomiêdzy automatycznymi zapisami" -#: src/config/options.inc:839 +#: src/config/options.inc:786 msgid "" "Interval at which to trigger information files in ~/.elinks\n" "to be saved to disk if they has changed (seconds; 0 to disable)" @@ -3721,11 +3615,11 @@ msgstr "" "Przedzia³ czasu po krórym w razie potrzeby nastêpuje zapis\n" "plików informacyjnych w ~/.elinks (w sekundach: 0 aby wy³±czyæ)" -#: src/config/options.inc:842 +#: src/config/options.inc:789 msgid "Use secure file saving" msgstr "U¿ywanie bezpiecznego zapisu plików" -#: src/config/options.inc:844 +#: src/config/options.inc:791 msgid "" "First write data to unique temporary file, then rename this file\n" "upon successfully finishing this. Note that this relates only to\n" @@ -3747,11 +3641,11 @@ msgstr "" "by docelowy plik nie istnia³, gdy rename() jest wywo³ywane,\n" "³ami±c atomowo¶æ i redukuj±c pewno¶æ zapisu." -#: src/config/options.inc:853 +#: src/config/options.inc:800 msgid "Use fsync(3) with secure file saving" msgstr "U¿ywanie fsync(3) przy bezpiecznym zapisie plików" -#: src/config/options.inc:855 +#: src/config/options.inc:802 msgid "" "When using secure file saving, call fsync(3), if the OS\n" "supports it, to force the OS immediately to write the data\n" @@ -3765,21 +3659,21 @@ msgstr "" # #. Keep options in alphabetical order. -#: src/config/options.inc:864 +#: src/config/options.inc:811 msgid "Terminals" msgstr "Terminale" # -#: src/config/options.inc:866 +#: src/config/options.inc:813 msgid "Terminal options." msgstr "Ustawienia terminala." -#: src/config/options.inc:870 +#: src/config/options.inc:817 msgid "Options specific to this terminal type (according to $TERM value)." msgstr "" "Ustawienia specyficzne dla danego typu terminala (nawi±zuj±c do $TERM)." -#: src/config/options.inc:874 +#: src/config/options.inc:821 msgid "" "Terminal type; matters mostly only when drawing frames and\n" "dialog box borders:\n" @@ -3797,11 +3691,11 @@ msgstr "" "3 - KOI-8\n" "4 - FreeBSD" -#: src/config/options.inc:882 src/dialogs/options.c:227 +#: src/config/options.inc:829 src/dialogs/options.c:225 msgid "Switch fonts for line drawing" msgstr "Zmiana fontu do rysowania linii" -#: src/config/options.inc:884 +#: src/config/options.inc:831 msgid "" "Switch fonts when drawing lines, enabling both local characters\n" "and lines working at the same time. Makes sense only with linux\n" @@ -3810,24 +3704,31 @@ msgstr "" "Zmienia font podczas rysowania linii, w³±czaj±c oba zestawy\n" "znaków. Ma sens jedynie na linuksowym terminalu." -#: src/config/options.inc:888 src/dialogs/options.c:232 +#. When CONFIG_UTF8 is defined, any code that reads the "utf_8_io" +#. * option should also check whether the "codepage" option is UTF-8, +#. * and if so, behave as if "utf_8_io" were 1. (When CONFIG_UTF8 is +#. * not defined, it should not be possible to set UTF-8 as "codepage"; +#. * please report any such possibilities as bugs.) +#: src/config/options.inc:840 src/dialogs/options.c:230 msgid "UTF-8 I/O" msgstr "I/O w UTF-8" -#: src/config/options.inc:890 +#: src/config/options.inc:842 msgid "" -"Enable I/O in UTF8 for Unicode terminals. Note that currently,\n" -"only the subset of UTF8 according to terminal codepage is used." +"Enable I/O in UTF-8 for Unicode terminals. Note that currently,\n" +"only the subset of UTF-8 according to terminal codepage is used.\n" +"ELinks ignores this option if the terminal codepage is UTF-8." msgstr "" -"W³±cza I/O w UTF8 na terminalach Unicode. Wiedz, ¿e obecnie\n" -"jedynie podzbiór UTF8 jest u¿ywany w zale¿no¶ci od u¿ywanej\n" -"strony kodowej." +"W³±cza I/O w UTF-8 na terminalach Unicode. Wiedz, ¿e obecnie\n" +"jedynie podzbiór UTF-8 jest u¿ywany w zale¿no¶ci od u¿ywanej\n" +"strony kodowej. ELinks pomija tê opcjê, je¶li stron± kodow±\n" +"terminala jest UTF-8." -#: src/config/options.inc:893 src/dialogs/options.c:228 +#: src/config/options.inc:846 src/dialogs/options.c:226 msgid "Restrict frames in cp850/852" msgstr "Ogranicz ramki w cp850/852" -#: src/config/options.inc:895 +#: src/config/options.inc:848 msgid "" "Restrict the characters used when drawing lines. Makes sense\n" "only with linux terminals using the cp850/852 character sets." @@ -3836,11 +3737,11 @@ msgstr "" "z terminalami linuksowymi u¿ywaj±cymi stron kodowych cp850/852." # -#: src/config/options.inc:898 src/dialogs/options.c:229 +#: src/config/options.inc:851 src/dialogs/options.c:227 msgid "Block cursor" msgstr "Kursor blokowy" -#: src/config/options.inc:900 +#: src/config/options.inc:853 msgid "" "Move cursor to bottom right corner when done drawing.\n" "This is particularly useful when we have a block cursor,\n" @@ -3850,28 +3751,42 @@ msgstr "" "rysowania. Jest to szczególnie u¿yteczne z kursorem\n" "blokowym, tekst z inwersj± jest wy¶wietlany poprawnie." -#: src/config/options.inc:906 +#. The list of modes must be at the end of this string +#. * because AsciiDoc 7.1.2 does not support continuing +#. * an outer list entry after an inner list. +#. * TRANSLATORS: This restriction applies only to the +#. * "en" (English) translation. (See doc/Makefile.) +#: src/config/options.inc:864 msgid "" -"The color mode controls what colors are used and how they are\n" -"output to the terminal. The color modes are:\n" +"The color mode controls what colors are used and how they are output to the " +"terminal.\n" +"Some modes may have been disabled at compile time. The Setup -> Terminal " +"options dialog lists the modes supported by this executable. If you select " +"an unsupported mode, ELinks uses 16 colors.\n" +"The color modes are:\n" "0 is mono mode, only 2 colors are used\n" "1 is 16 color mode, uses the common ANSI colors\n" -"2 is 256 color mode, uses XTerm RGB codes\n" -"3 is true color mode, uses konsole RGB codes." +"2 is 88 color mode, uses XTerm RGB codes\n" +"3 is 256 color mode, uses XTerm RGB codes\n" +"4 is true color mode, uses konsole RGB codes" msgstr "" -"Tryb kolorowy kontroluje, które kolory s± u¿ywane i w jaki\n" -"sposób s± wy¶wietlane na terminalu. Mo¿liwe do u¿ycia tryby\n" -"kolorowe to:\n" +"Tryb kolorowy kontroluje, które kolory s± u¿ywane i w jaki sposób s± " +"wy¶wietlane na terminalu. Niektóre z tych trybów mog± byæ wy³±czone przy " +"kompilacji. Lista dostêpnych trybów jest widoczna poprzez Ustawienia -> " +"Opcje terminala. Je¶li wybierzesz nie obs³ugiwany tryb, ELinks u¿yje trybu " +"16 kolorów.\n" +"Mo¿liwe do u¿ycia tryby kolorowe to:\n" "0 - tryb monochromatyczny\n" "1 - tryb 16 kolorowy, u¿ywa standardowych kolorów ANSI\n" -"2 - tryb 256 kolorowy, u¿ywa kodów RGB xterma\n" -"3 - tryb koloru 24-bitowy, u¿ywa kodów RGB konsole." +"2 - tryb 88 kolorowy, u¿ywa kodów RGB xterma\n" +"3 - tryb 256 kolorowy, u¿ywa kodów RGB xterma\n" +"4 - tryb koloru 24-bitowy, u¿ywa kodów RGB konsole" -#: src/config/options.inc:913 src/dialogs/options.c:230 +#: src/config/options.inc:877 src/dialogs/options.c:228 msgid "Transparency" msgstr "Przezroczysto¶æ" -#: src/config/options.inc:915 +#: src/config/options.inc:879 msgid "" "If we should not set the background to black. This is particularly\n" "useful when we have a terminal (typically in some windowing\n" @@ -3891,11 +3806,11 @@ msgstr "" "jest jasne). Wiedz, ¿e to ustawienie ma sens jedynie, gdy u¿ywanie\n" "kolorów jest w³±czone." -#: src/config/options.inc:925 +#: src/config/options.inc:889 msgid "If we should use underline or enhance the color instead." msgstr "Czy powinno siê u¿ywaæ podkre¶lenia czy wzmocnienia koloru." -#: src/config/options.inc:929 +#: src/config/options.inc:893 msgid "" "Codepage of charset used for displaying content on terminal.\n" "'System' stands for a codepage determined by a selected locale." @@ -3904,347 +3819,347 @@ msgstr "" "'System' oznacza i¿ zostanie okre¶lona przez wybrane locale." #. Keep options in alphabetical order. -#: src/config/options.inc:936 +#: src/config/options.inc:900 msgid "User interface" msgstr "Interfejs u¿ytkownika" # -#: src/config/options.inc:938 +#: src/config/options.inc:902 msgid "User interface options." msgstr "Ustawienia interfejsu u¿ytkownika." -#: src/config/options.inc:942 +#: src/config/options.inc:906 msgid "Color settings" msgstr "Ustawienia kolorów" -#: src/config/options.inc:944 +#: src/config/options.inc:908 msgid "Default user interface color settings." msgstr "Domy¶lne ustawienia kolorów interfejsu u¿ytkownika." # -#: src/config/options.inc:971 +#: src/config/options.inc:935 msgid "Color terminals" msgstr "Kolorowe terminale" -#: src/config/options.inc:973 +#: src/config/options.inc:937 msgid "Color settings for color terminal." msgstr "Ustawienia kolorów dla kolorowych terminali." -#: src/config/options.inc:975 +#: src/config/options.inc:939 msgid "Non-color terminals" msgstr "Terminale monochromatyczne" -#: src/config/options.inc:977 +#: src/config/options.inc:941 msgid "Color settings for non-color terminal." msgstr "Ustawienia kolorów dla terminali monochromatycznych." #. FIXME: obsolete, how to alias them correctly ? --Zas -#: src/config/options.inc:980 +#: src/config/options.inc:944 msgid "Main menu bar" msgstr "Pasek menu g³ównego" -#: src/config/options.inc:982 +#: src/config/options.inc:946 msgid "Main menu bar colors." msgstr "Kolory g³ównego paska menu." -#: src/config/options.inc:984 +#: src/config/options.inc:948 msgid "Unselected main menu bar item" msgstr "Pasek niewybranego elementu menu" -#: src/config/options.inc:986 +#: src/config/options.inc:950 msgid "Unselected main menu bar item colors." msgstr "Kolory dla paska niewybranego elementu menu." -#: src/config/options.inc:988 +#: src/config/options.inc:952 msgid "Selected main menu bar item" msgstr "Pasek wybranego elementu menu" -#: src/config/options.inc:990 +#: src/config/options.inc:954 msgid "Selected main menu bar item colors." msgstr "Kolory dla paska wybranego elementu menu." -#: src/config/options.inc:992 src/config/options.inc:1021 +#: src/config/options.inc:956 src/config/options.inc:985 msgid "Hotkey" msgstr "Klawisz skrótu" -#: src/config/options.inc:994 +#: src/config/options.inc:958 msgid "Main menu hotkey colors." msgstr "Kolory klawiszy skrótu g³ównego paska menu." -#: src/config/options.inc:996 src/config/options.inc:1025 +#: src/config/options.inc:960 src/config/options.inc:989 msgid "Unselected hotkey" msgstr "Niewybrany klawisz skrótu" -#: src/config/options.inc:998 +#: src/config/options.inc:962 msgid "Main menu unselected hotkey colors." msgstr "Kolory niewybranych klawiszy skrótu g³ównego menu." # -#: src/config/options.inc:1000 src/config/options.inc:1029 +#: src/config/options.inc:964 src/config/options.inc:993 msgid "Selected hotkey" msgstr "Wybrany klawisz skrótu" -#: src/config/options.inc:1002 +#: src/config/options.inc:966 msgid "Main menu selected hotkey colors." msgstr "Kolory wybranych klawiszy skrótu g³ównego menu." -#: src/config/options.inc:1005 +#: src/config/options.inc:969 msgid "Menu bar" msgstr "Pasek menu" -#: src/config/options.inc:1007 +#: src/config/options.inc:971 msgid "Menu bar colors." msgstr "Kolory paska menu." -#: src/config/options.inc:1009 +#: src/config/options.inc:973 msgid "Unselected menu item" msgstr "Niewybrane elementy menu" -#: src/config/options.inc:1011 +#: src/config/options.inc:975 msgid "Unselected menu item colors." msgstr "Kolory niewybranego elementu menu." # -#: src/config/options.inc:1013 +#: src/config/options.inc:977 msgid "Selected menu item" msgstr "Pod¶wietlone elementy menu" -#: src/config/options.inc:1015 +#: src/config/options.inc:979 msgid "Selected menu item colors." msgstr "Kolory wybranych elementów menu." # -#: src/config/options.inc:1017 +#: src/config/options.inc:981 msgid "Marked menu item" msgstr "Pod¶wietlone elementy menu" -#: src/config/options.inc:1019 +#: src/config/options.inc:983 msgid "Marked menu item colors." msgstr "Kolory pod¶wietlonych elementów menu." -#: src/config/options.inc:1023 +#: src/config/options.inc:987 msgid "Menu item hotkey colors." msgstr "Kolory klawiszy skrótu menu." -#: src/config/options.inc:1027 +#: src/config/options.inc:991 msgid "Menu item unselected hotkey colors." msgstr "Kolory niewybranych klawiszy skrótu menu." -#: src/config/options.inc:1031 +#: src/config/options.inc:995 msgid "Menu item selected hotkey colors." msgstr "Kolory wybranych klawiszy skrótu menu." # -#: src/config/options.inc:1033 +#: src/config/options.inc:997 msgid "Menu frame" msgstr "Ramka menu" -#: src/config/options.inc:1035 +#: src/config/options.inc:999 msgid "Menu frame colors." msgstr "Kolory ramki menu." -#: src/config/options.inc:1038 +#: src/config/options.inc:1002 msgid "Dialog" msgstr "Okno dialogowe" -#: src/config/options.inc:1040 +#: src/config/options.inc:1004 msgid "Dialog colors." msgstr "Kolory okna dialogowego." -#: src/config/options.inc:1050 +#: src/config/options.inc:1014 msgid "Generic" msgstr "Zwyk³e" -#: src/config/options.inc:1052 +#: src/config/options.inc:1016 msgid "Generic dialog colors." msgstr "Zwyk³e kolory okienka dialogowego." # -#: src/config/options.inc:1054 +#: src/config/options.inc:1018 msgid "Frame" msgstr "Ramka" -#: src/config/options.inc:1056 +#: src/config/options.inc:1020 msgid "Dialog frame colors." msgstr "Kolory ramki okna dialogowego." -#: src/config/options.inc:1058 +#: src/config/options.inc:1022 msgid "Scrollbar" msgstr "Pasek przewijania" -#: src/config/options.inc:1060 +#: src/config/options.inc:1024 msgid "Scrollbar colors." msgstr "Kolory paska przewijania." -#: src/config/options.inc:1062 +#: src/config/options.inc:1026 msgid "Selected scrollbar" msgstr "Wybrany pasek przewijania" -#: src/config/options.inc:1064 +#: src/config/options.inc:1028 msgid "Scrollbar selected colors." msgstr "Kolory wybranego paska przewijania." -#: src/config/options.inc:1068 +#: src/config/options.inc:1032 msgid "Dialog title colors." msgstr "Kolory tytu³u okna dialogowego." # -#: src/config/options.inc:1070 +#: src/config/options.inc:1034 msgid "Text" msgstr "Tekst" -#: src/config/options.inc:1072 +#: src/config/options.inc:1036 msgid "Dialog text colors." msgstr "Kolory tekstu w oknie dialogowym." -#: src/config/options.inc:1074 src/viewer/text/form.c:1801 +#: src/config/options.inc:1038 src/viewer/text/form.c:1802 msgid "Checkbox" msgstr "Przycisk wyboru" -#: src/config/options.inc:1076 +#: src/config/options.inc:1040 msgid "Dialog checkbox colors." msgstr "Kolory przycisku wyboru." # -#: src/config/options.inc:1078 +#: src/config/options.inc:1042 msgid "Selected checkbox" msgstr "Wybrany przycisk wyboru" -#: src/config/options.inc:1080 +#: src/config/options.inc:1044 msgid "Dialog selected checkbox colors." msgstr "Kolory wybranego przycisku wyboru." # -#: src/config/options.inc:1082 +#: src/config/options.inc:1046 msgid "Checkbox label" msgstr "Etykieta przycisku wyboru" -#: src/config/options.inc:1084 +#: src/config/options.inc:1048 msgid "Dialog checkbox label colors." msgstr "Kolory etykiety przycisku wyboru." -#: src/config/options.inc:1086 +#: src/config/options.inc:1050 msgid "Button" msgstr "Przycisk" -#: src/config/options.inc:1088 src/config/options.inc:1096 +#: src/config/options.inc:1052 src/config/options.inc:1060 msgid "Dialog button colors." msgstr "Kolory przycisku." # -#: src/config/options.inc:1090 +#: src/config/options.inc:1054 msgid "Selected button" msgstr "Wybrany przycisk" -#: src/config/options.inc:1092 src/config/options.inc:1100 +#: src/config/options.inc:1056 src/config/options.inc:1064 msgid "Dialog selected button colors." msgstr "Kolory wybranego przycisku." -#: src/config/options.inc:1094 +#: src/config/options.inc:1058 msgid "Button shortcut" msgstr "Klawisz skrótu przycisku" # -#: src/config/options.inc:1098 +#: src/config/options.inc:1062 msgid "Selected button shortcut" msgstr "Klawisz skrótu wybranego przycisku" -#: src/config/options.inc:1102 src/viewer/text/form.c:1805 +#: src/config/options.inc:1066 src/viewer/text/form.c:1806 msgid "Text field" msgstr "Pole tekstowe" -#: src/config/options.inc:1104 +#: src/config/options.inc:1068 msgid "Dialog text field colors." msgstr "Kolory pola tekstowego." # -#: src/config/options.inc:1106 +#: src/config/options.inc:1070 msgid "Text field text" msgstr "Tekst w polu tekstowym" -#: src/config/options.inc:1108 +#: src/config/options.inc:1072 msgid "Dialog field text colors." msgstr "Kolory tekstu w polu tekstowym." -#: src/config/options.inc:1110 +#: src/config/options.inc:1074 msgid "Meter" msgstr "Licznik" -#: src/config/options.inc:1112 +#: src/config/options.inc:1076 msgid "Dialog meter colors." msgstr "Kolory licznika." -#: src/config/options.inc:1114 +#: src/config/options.inc:1078 msgid "Shadow" msgstr "Cieñ" -#: src/config/options.inc:1116 +#: src/config/options.inc:1080 msgid "Dialog shadow colors (see ui.shadows option)." msgstr "Kolory cienia (zobacz opcjê ui.shadows)." # -#: src/config/options.inc:1118 +#: src/config/options.inc:1082 msgid "Title bar" msgstr "Pasek tytu³owy" -#: src/config/options.inc:1120 +#: src/config/options.inc:1084 msgid "Title bar colors." msgstr "Kolory paska tytu³owego." -#: src/config/options.inc:1122 +#: src/config/options.inc:1086 msgid "Generic title bar" msgstr "Zwyk³y pasek tytu³owy" -#: src/config/options.inc:1124 +#: src/config/options.inc:1088 msgid "Generic title bar colors." msgstr "Kolory zwyk³ego paska tytu³owego." -#: src/config/options.inc:1126 +#: src/config/options.inc:1090 msgid "Title bar text" msgstr "Tekst na pasku tytu³owym" -#: src/config/options.inc:1128 +#: src/config/options.inc:1092 msgid "Title bar text colors." msgstr "Kolory tekstu na pasku tytu³owym." -#: src/config/options.inc:1131 +#: src/config/options.inc:1095 msgid "Status bar" msgstr "Pasek statusu" -#: src/config/options.inc:1133 +#: src/config/options.inc:1097 msgid "Status bar colors." msgstr "Kolory paska statusu." -#: src/config/options.inc:1135 +#: src/config/options.inc:1099 msgid "Generic status bar" msgstr "Zwyk³y pasek statusu" -#: src/config/options.inc:1137 +#: src/config/options.inc:1101 msgid "Generic status bar colors." msgstr "Kolory zwyk³ego paska statusu." # -#: src/config/options.inc:1139 +#: src/config/options.inc:1103 msgid "Status bar text" msgstr "Tekst na pasku statusu" -#: src/config/options.inc:1141 +#: src/config/options.inc:1105 msgid "Status bar text colors." msgstr "Kolory tekstu na pasku statusu." -#: src/config/options.inc:1144 +#: src/config/options.inc:1108 msgid "Tabs bar" msgstr "Pasek kart" -#: src/config/options.inc:1146 +#: src/config/options.inc:1110 msgid "Tabs bar colors." msgstr "Kolory paska kart." -#: src/config/options.inc:1148 +#: src/config/options.inc:1112 msgid "Unvisited tab" msgstr "Nieodwiedzana karta" -#: src/config/options.inc:1150 +#: src/config/options.inc:1114 msgid "" "Tab colors for tabs that have not been\n" "selected since they completed loading." @@ -4252,44 +4167,44 @@ msgstr "" "Kolory karty dla kart, które nie zosta³y\n" "wybrane od zakoñczenia ³adowania." -#: src/config/options.inc:1153 +#: src/config/options.inc:1117 msgid "Unselected tab" msgstr "Niewybrana karta" -#: src/config/options.inc:1155 +#: src/config/options.inc:1119 msgid "Unselected tab colors." msgstr "Kolory niewybranych kart." -#: src/config/options.inc:1157 +#: src/config/options.inc:1121 msgid "Loading tab" msgstr "Karta, do której wczytywany jest dokument" -#: src/config/options.inc:1159 +#: src/config/options.inc:1123 msgid "Tab colors for tabs that are loading in the background." msgstr "Kolory kart dla kart, do których wczytywany jest dokument w tle." # -#: src/config/options.inc:1161 +#: src/config/options.inc:1125 msgid "Selected tab" msgstr "Wybrana karta" -#: src/config/options.inc:1163 +#: src/config/options.inc:1127 msgid "Selected tab colors." msgstr "Kolory wybranej karty." -#: src/config/options.inc:1165 +#: src/config/options.inc:1129 msgid "Tab separator" msgstr "Separator kart" -#: src/config/options.inc:1167 +#: src/config/options.inc:1131 msgid "Tab separator colors." msgstr "Kolory separatora kart." -#: src/config/options.inc:1170 +#: src/config/options.inc:1134 msgid "Searched strings" msgstr "Szukane ³añcuchy" -#: src/config/options.inc:1172 +#: src/config/options.inc:1136 msgid "Searched string highlight colors." msgstr "Kolory pod¶wietlenia szukanych ³añcuchów." @@ -4297,19 +4212,19 @@ msgstr "Kolory pod #. ============= BORING PART (colors) END =================== #. ========================================================== #. Keep options in alphabetical order. -#: src/config/options.inc:1181 +#: src/config/options.inc:1145 msgid "Dialog settings" msgstr "Ustawienia okien dialogowych" -#: src/config/options.inc:1183 +#: src/config/options.inc:1147 msgid "Dialogs-specific appearance and behaviour settings." msgstr "Ustawienia dotycz±ce wygl±du i zachowania okien dialogowych." -#: src/config/options.inc:1186 +#: src/config/options.inc:1150 msgid "Minimal height of listbox widget" msgstr "Minimalna wysoko¶æ listy wyboru" -#: src/config/options.inc:1188 +#: src/config/options.inc:1152 msgid "" "Minimal height of the listbox widget (used e.g. for bookmarks\n" "or global history)." @@ -4317,11 +4232,11 @@ msgstr "" "Minimalna wysoko¶æ listy wyboru (u¿ywanej np. przy zak³adkach\n" "czy globalnej historii)." -#: src/config/options.inc:1191 +#: src/config/options.inc:1155 msgid "Drop shadows" msgstr "Rzucanie cienia" -#: src/config/options.inc:1193 +#: src/config/options.inc:1157 msgid "" "Make dialogs drop shadows (the shadows are solid, you can\n" "adjust their color by ui.colors.*.dialog.shadow). You may\n" @@ -4332,11 +4247,11 @@ msgstr "" "ui.colors.*.dialog.shadow). Mo¿esz te¿ wyeliminowaæ szerokie\n" "obrze¿a przez dostosowanie pliku setup.h." -#: src/config/options.inc:1197 +#: src/config/options.inc:1161 msgid "Underline menu hotkeys" msgstr "Podkre¶lanie klawiszy skrótu menu" -#: src/config/options.inc:1199 +#: src/config/options.inc:1163 msgid "" "Whether to underline hotkeys in menus to make them more\n" "visible. Requires the underlining is enabled for the terminal." @@ -4344,11 +4259,11 @@ msgstr "" "Czy podkre¶laæ klawisze skrótu w menu, by by³y bardziej\n" "widoczne? Wymaga w³±czenia podkre¶lania dla terminala." -#: src/config/options.inc:1202 +#: src/config/options.inc:1166 msgid "Underline button shortcuts" msgstr "Podkre¶lanie klawiszy skrótu przycisku" -#: src/config/options.inc:1204 +#: src/config/options.inc:1168 msgid "" "Whether to underline button shortcuts to make them more\n" "visible. Requires the underlining is enabled for the terminal." @@ -4357,11 +4272,11 @@ msgstr "" "widoczne? Wymaga w³±czenia podkre¶lania dla terminala." # -#: src/config/options.inc:1208 +#: src/config/options.inc:1172 msgid "Timer options" msgstr "Ustawienia stopera" -#: src/config/options.inc:1210 +#: src/config/options.inc:1174 msgid "" "Timed action after certain interval of user inactivity. Someone can\n" "even find this useful, although you may not believe that." @@ -4369,7 +4284,7 @@ msgstr "" "Odmierzane akcje po pewnym okresie bezczynno¶ci u¿ytkownika.\n" "Komu¶ mo¿e siê to przyda, chocia¿ mo¿esz w to nie wierzyæ." -#: src/config/options.inc:1216 +#: src/config/options.inc:1180 msgid "" "Whether to enable the timer or not:\n" "0 is don't count down anything\n" @@ -4381,7 +4296,7 @@ msgstr "" "1 - odlicza, ale nie pokazuje stopera\n" "2 - odlicza i pokazuje stoper w pobli¿u LEDów" -#: src/config/options.inc:1223 +#: src/config/options.inc:1187 msgid "" "Whether to enable the timer or not:\n" "0 is don't count down anything\n" @@ -4394,37 +4309,37 @@ msgstr "" "2 - odlicza i pokazuje stoper w pobli¿u LEDów (WY£¡CZONE)" # -#: src/config/options.inc:1229 +#: src/config/options.inc:1193 msgid "Duration" msgstr "Czas trwania" -#: src/config/options.inc:1231 +#: src/config/options.inc:1195 msgid "" "Inactivity timeout in seconds. The maximum of one day\n" "should be enough for just everyone (TM)." msgstr "" "Limit czasu bezczynno¶ci. Jeden dzieñ powinien wystarczyæ ka¿demu (TM)." -#: src/config/options.inc:1236 +#: src/config/options.inc:1200 msgid "Keybinding action to be triggered when timer reaches zero." msgstr "" "Akcja powi±zana z klawiatur±, która ma byæ wyzwolona gdy\n" "stoper osi±gnie zero." -#: src/config/options.inc:1239 +#: src/config/options.inc:1203 msgid "Window tabs" msgstr "Karty" -#: src/config/options.inc:1241 +#: src/config/options.inc:1205 msgid "Window tabs settings." msgstr "Ustawienia kart." # -#: src/config/options.inc:1243 +#: src/config/options.inc:1207 msgid "Display tabs bar" msgstr "Wy¶wietl pasek kart" -#: src/config/options.inc:1245 +#: src/config/options.inc:1209 msgid "" "Show tabs bar on the screen:\n" "0 means never\n" @@ -4436,39 +4351,39 @@ msgstr "" "1 - tylko gdy wiêcej ni¿ jedna karta jest otwarta\n" "2 - zawsze" -#: src/config/options.inc:1250 +#: src/config/options.inc:1214 msgid "Tab bar at top" msgstr "Pasek kart u góry" -#: src/config/options.inc:1252 +#: src/config/options.inc:1216 msgid "Whether display tab bar at top like other browsers do." msgstr "" "Czy wy¶wietlaæ pasek kart u góry strony, tak jak w innych\n" "przegl±darkach." -#: src/config/options.inc:1254 +#: src/config/options.inc:1218 msgid "Wrap-around tabs cycling" msgstr "Cykliczno¶æ kart" -#: src/config/options.inc:1256 +#: src/config/options.inc:1220 msgid "" "When moving right from the last tab, jump at the first one, and\n" "vice versa." msgstr "Przeskakiwanie z ostatniej karty do pierwszej i na odwrót." -#: src/config/options.inc:1259 +#: src/config/options.inc:1223 msgid "Confirm tab closing" msgstr "Potwierdzenie zamkniêcia karty" -#: src/config/options.inc:1261 +#: src/config/options.inc:1225 msgid "When closing a tab show confirmation dialog." msgstr "Przy zamykaniu karty pokazuj okienko dialogowe potwierdzania." -#: src/config/options.inc:1265 src/config/opttypes.c:409 +#: src/config/options.inc:1229 src/config/opttypes.c:409 msgid "Language" msgstr "Jêzyk" -#: src/config/options.inc:1267 +#: src/config/options.inc:1231 msgid "" "Language of user interface. 'System' means that the language will\n" "be extracted from the environment dynamically." @@ -4477,37 +4392,37 @@ msgstr "" "zostanie uzyskany ze ¶rodowiska w sposób dynamiczny." # -#: src/config/options.inc:1270 +#: src/config/options.inc:1234 msgid "Display menu bar always" msgstr "Wy¶wietlanie paska tytu³owego na sta³e" -#: src/config/options.inc:1272 +#: src/config/options.inc:1236 msgid "Always show menu bar on the screen." msgstr "Zawsze pokazuj pasek tytu³owy na ekranie." # -#: src/config/options.inc:1274 +#: src/config/options.inc:1238 msgid "Display status bar" msgstr "Wy¶wietlanie paska statusu" -#: src/config/options.inc:1276 +#: src/config/options.inc:1240 msgid "Show status bar on the screen." msgstr "Pokazuje pasek statusu na ekranie." # -#: src/config/options.inc:1278 +#: src/config/options.inc:1242 msgid "Display title bar" msgstr "Wy¶wietlanie paska tytu³owego" -#: src/config/options.inc:1280 +#: src/config/options.inc:1244 msgid "Show title bar on the screen." msgstr "Pokazuje pasek tytu³owy na ekranie." -#: src/config/options.inc:1282 +#: src/config/options.inc:1246 msgid "Display goto dialog in new tabs" msgstr "Wy¶wietlanie okienka \"goto\" w nowych kartach" -#: src/config/options.inc:1284 +#: src/config/options.inc:1248 msgid "" "Pop up goto dialog in newly created tabs when there's no homepage\n" "set. This means also showing goto dialog on startup." @@ -4516,11 +4431,11 @@ msgstr "" "je¶li strona domowa nie jest ustawiona. Oznacza to i¿ okno\n" "to bêdzie pokazywane tak¿e przy starcie." -#: src/config/options.inc:1287 +#: src/config/options.inc:1251 msgid "Show a message box when file is saved successfully" msgstr "Pokazuj okienko dialogowe, gdy plik zostanie pomy¶lnie zapisany" -#: src/config/options.inc:1289 +#: src/config/options.inc:1253 msgid "" "When you pressed a [ Save ] button in some manager, this option\n" "will make sure that a box confirming success of the operation will\n" @@ -4530,27 +4445,27 @@ msgstr "" "te ustawienie zapewni, ¿e pojawi siê okienko potwierdzaj±ce\n" "pomy¶lne wykonanie operacji." -#: src/config/options.inc:1294 +#: src/config/options.inc:1258 msgid "Sessions" msgstr "Sesje" -#: src/config/options.inc:1296 +#: src/config/options.inc:1260 msgid "Sessions settings." msgstr "Ustawienia sesji." -#: src/config/options.inc:1298 +#: src/config/options.inc:1262 msgid "Keep session active" msgstr "Utrzymuj aktywn± sesjê" -#: src/config/options.inc:1300 +#: src/config/options.inc:1264 msgid "Keep the session active even if the last terminal exits." msgstr "Utrzymuj sesjê nawet po zamkniêciu ostatniego terminala." -#: src/config/options.inc:1302 +#: src/config/options.inc:1266 msgid "Auto save session" msgstr "Automatyczne zapisywanie sesji" -#: src/config/options.inc:1304 +#: src/config/options.inc:1268 msgid "" "Automatically save the session when quitting.\n" "This feature requires bookmark support." @@ -4558,11 +4473,11 @@ msgstr "" "Automatycznie zapisuj sesjê przy koñczeniu dzia³ania.\n" "Wymagana jest obs³uga zak³adek." -#: src/config/options.inc:1307 +#: src/config/options.inc:1271 msgid "Auto restore session" msgstr "Automatyczne odtwarzanie sesji" -#: src/config/options.inc:1309 +#: src/config/options.inc:1273 msgid "" "Automatically restore the session at start.\n" "This feature requires bookmark support." @@ -4570,11 +4485,11 @@ msgstr "" "Automatycznie odtwarzaj sesjê na starcie.\n" "Wymagana jest obs³uga zak³adek." -#: src/config/options.inc:1312 +#: src/config/options.inc:1276 msgid "Auto save and restore session folder name" msgstr "Nazwa foldera do automatycznego zapisywania i odtwarzania sesji" -#: src/config/options.inc:1314 +#: src/config/options.inc:1278 msgid "" "Name of the bookmarks folder used for auto saving and restoring session.\n" "The name has to be unique. Any folders with the same name will be deleted.\n" @@ -4585,11 +4500,11 @@ msgstr "" "Foldery o takiej samej nazwie zostan± usuniête. Ma to sens\n" "jedynie wtedy, gdy wkompilowana jest obs³uga zak³adek." -#: src/config/options.inc:1318 +#: src/config/options.inc:1282 msgid "Homepage URI" msgstr "URI strony domowej" -#: src/config/options.inc:1320 +#: src/config/options.inc:1284 msgid "" "The URI to load either at startup time when no URI was given\n" "on the command line or when requested by the goto-url-home action.\n" @@ -4602,20 +4517,20 @@ msgstr "" "¶rodowiskowej WWW_HOME powinna byæ u¿yta jako strona domowa." # -#: src/config/options.inc:1326 +#: src/config/options.inc:1290 msgid "Date format" msgstr "Format daty" -#: src/config/options.inc:1328 +#: src/config/options.inc:1292 msgid "Date format to use in dialogs. See strftime(3)." msgstr "Format daty u¿ywany w dialog. Zobacz strftime(3)." # -#: src/config/options.inc:1331 +#: src/config/options.inc:1295 msgid "Set window title" msgstr "Ustalenie tytu³u okna" -#: src/config/options.inc:1333 +#: src/config/options.inc:1297 msgid "" "Set the window title when running in a windowing environment\n" "in an xterm-like terminal. This way the document's title is\n" @@ -4700,20 +4615,20 @@ msgid "Goto URL History" msgstr "Historia \"Przejd¼ do URL-a\"" #. name: -#: src/cookies/cookies.c:87 src/cookies/cookies.c:865 +#: src/cookies/cookies.c:89 src/cookies/cookies.c:938 msgid "Cookies" msgstr "Ciasteczka" # -#: src/cookies/cookies.c:89 +#: src/cookies/cookies.c:91 msgid "Cookies options." msgstr "Ciasteczka - ustawienia." -#: src/cookies/cookies.c:91 +#: src/cookies/cookies.c:93 msgid "Accept policy" msgstr "Polisa akceptacji" -#: src/cookies/cookies.c:94 +#: src/cookies/cookies.c:96 msgid "" "Cookies accepting policy:\n" "0 is accept no cookies\n" @@ -4726,11 +4641,11 @@ msgstr "" "2 - akceptuj wszystkie ciasteczka" # -#: src/cookies/cookies.c:99 +#: src/cookies/cookies.c:101 msgid "Maximum age" msgstr "Maksymalny czas ¿ycia" -#: src/cookies/cookies.c:101 +#: src/cookies/cookies.c:103 msgid "" "Cookie maximum age (in days):\n" "-1 is use cookie's expiration date if any\n" @@ -4746,11 +4661,11 @@ msgstr "" "1+ - u¿yj daty przedawnienia ciasteczka, ograniczaj±c czas\n" " ¿ycia do podanej liczby dni" -#: src/cookies/cookies.c:108 +#: src/cookies/cookies.c:110 msgid "Paranoid security" msgstr "Paranoidalne bezpieczeñstwo" -#: src/cookies/cookies.c:110 +#: src/cookies/cookies.c:112 msgid "" "When enabled, we'll require three dots in cookies domain for all\n" "non-international domains (instead of just two dots). Some countries\n" @@ -4767,19 +4682,19 @@ msgstr "" "b³êdy na wielu stronach." # -#: src/cookies/cookies.c:116 +#: src/cookies/cookies.c:118 msgid "Saving" msgstr "Zapis" -#: src/cookies/cookies.c:118 +#: src/cookies/cookies.c:120 msgid "Whether cookies should be loaded from and save to disk." msgstr "Czy ciasteczka powinny byæ wczytywane i zapisywane na dysk." -#: src/cookies/cookies.c:120 +#: src/cookies/cookies.c:122 msgid "Resaving" msgstr "Nadpisywanie" -#: src/cookies/cookies.c:122 +#: src/cookies/cookies.c:124 msgid "" "Save cookies after each change in cookies list? No effect when\n" "cookie saving (cookies.save) is off." @@ -4787,8 +4702,20 @@ msgstr "" "Czy zapisywaæ ciasteczka po ka¿dej zmianie na li¶cie\n" "ciasteczek? Bez efektu, gdy cookies_save jest wy³±czone." +#: src/cookies/cookies.c:844 +msgid "Cannot save cookies" +msgstr "Nie mo¿na zapisaæ ciasteczek" + +#: src/cookies/cookies.c:855 +msgid "ELinks was started without a home directory." +msgstr "ELinks zosta³ uruchomiony bez katalogu domowego." + +#: src/cookies/cookies.c:861 +msgid "ELinks was started with the -anonymous option." +msgstr "ELinks zosta³ uruchomiony z opcj± -anonymous." + # -#: src/cookies/dialogs.c:36 src/cookies/dialogs.c:352 +#: src/cookies/dialogs.c:36 src/cookies/dialogs.c:368 msgid "Domain" msgstr "Domena" @@ -4801,7 +4728,7 @@ msgstr " msgid "at quit time" msgstr "w momencie koñczenia dzia³ania" -#: src/cookies/dialogs.c:49 src/cookies/dialogs.c:354 +#: src/cookies/dialogs.c:49 src/cookies/dialogs.c:370 msgid "Secure" msgstr "Bezpieczne" @@ -4813,116 +4740,116 @@ msgstr "tak" msgid "no" msgstr "nie" -#: src/cookies/dialogs.c:70 +#: src/cookies/dialogs.c:82 #, c-format msgid "Do you want to accept a cookie from %s?" msgstr "Czy chcesz zaakceptowaæ ciasteczko z %s?" -#: src/cookies/dialogs.c:78 +#: src/cookies/dialogs.c:90 msgid "Accept cookie?" msgstr "Akceptujesz ciasteczko?" #. accelerator_context(accept_cookie_dialog) -#: src/cookies/dialogs.c:81 +#: src/cookies/dialogs.c:93 msgid "~Accept" msgstr "~Akceptacja" #. accelerator_context(accept_cookie_dialog) -#: src/cookies/dialogs.c:82 +#: src/cookies/dialogs.c:94 msgid "~Reject" msgstr "Od~rzucenie" -#: src/cookies/dialogs.c:149 src/cookies/dialogs.c:342 +#: src/cookies/dialogs.c:161 src/cookies/dialogs.c:357 #: src/dialogs/document.c:177 msgid "Server" msgstr "Serwer" #. cant_delete_item -#: src/cookies/dialogs.c:201 +#: src/cookies/dialogs.c:209 #, c-format msgid "Sorry, but cookie \"%s\" cannot be deleted." msgstr "Przykro mi, ale ciasteczko \"%s\" nie mo¿e byæ usuniête." #. cant_delete_used_item -#: src/cookies/dialogs.c:203 +#: src/cookies/dialogs.c:211 #, c-format msgid "Sorry, but cookie \"%s\" is being used by something else." msgstr "Przykro mi, ale ciasteczko \"%s\" jest u¿ywane przez co¶ innego." #. cant_delete_folder -#: src/cookies/dialogs.c:205 +#: src/cookies/dialogs.c:213 #, c-format msgid "Sorry, but cookie domain \"%s\" cannot be deleted." msgstr "Przykro mi, ale domena ciasteczka \"%s\" nie mo¿e byæ usuniêta." #. cant_delete_used_folder -#: src/cookies/dialogs.c:207 +#: src/cookies/dialogs.c:215 #, c-format msgid "Sorry, but cookie domain \"%s\" is being used by something else." msgstr "" "Przykro mi, ale domena ciasteczka \"%s\" jest u¿ywane przez co¶ innego." #. delete_marked_items_title -#: src/cookies/dialogs.c:209 +#: src/cookies/dialogs.c:217 msgid "Delete marked cookies" msgstr "Usuwanie zaznaczonych ciasteczek" #. delete_marked_items -#: src/cookies/dialogs.c:211 +#: src/cookies/dialogs.c:219 msgid "Delete marked cookies?" msgstr "Czy usun±æ zaznaczone ciasteczka?" #. delete_folder_title -#: src/cookies/dialogs.c:213 +#: src/cookies/dialogs.c:221 msgid "Delete domain's cookies" msgstr "Usuwanie ciasteczek z danej domeny" #. delete_folder -#: src/cookies/dialogs.c:215 +#: src/cookies/dialogs.c:223 #, c-format msgid "Delete all cookies from domain \"%s\"?" msgstr "Czy usun±æ wszystkie ciasteczka z domeny \"%s\"?" #. delete_item_title -#: src/cookies/dialogs.c:217 +#: src/cookies/dialogs.c:225 msgid "Delete cookie" msgstr "Usuwanie ciasteczka" -#: src/cookies/dialogs.c:219 +#: src/cookies/dialogs.c:227 #, c-format msgid "Delete this cookie?" msgstr "Czy usun±æ to ciasteczko?" #. clear_all_items_title -#: src/cookies/dialogs.c:221 +#: src/cookies/dialogs.c:229 msgid "Clear all cookies" msgstr "Skasowanie wszystkich ciasteczek" #. clear_all_items_title -#: src/cookies/dialogs.c:223 +#: src/cookies/dialogs.c:231 msgid "Do you really want to remove all cookies?" msgstr "Czy na pewno chcesz skasowaæ wszystkie ciasteczka?" -#: src/cookies/dialogs.c:448 +#: src/cookies/dialogs.c:464 msgid "Add server" msgstr "Dodaj serwer" -#: src/cookies/dialogs.c:452 +#: src/cookies/dialogs.c:468 msgid "Server name" msgstr "Nazwa serwera" #. accelerator_context(src/cookies/dialogs.c:cookie_buttons) -#: src/cookies/dialogs.c:475 +#: src/cookies/dialogs.c:491 msgid "Add ~server" msgstr "Dodaj ~serwer" #. accelerator_context(do_edit_dialog, src/cookies/dialogs.c:cookie_buttons, src/dialogs/download.c:download_buttons, src/globhist/dialogs.c:globhist_buttons, src/protocol/auth/dialogs.c:auth_buttons) -#: src/cookies/dialogs.c:478 src/dialogs/download.c:498 src/dialogs/edit.c:99 +#: src/cookies/dialogs.c:494 src/dialogs/download.c:498 src/dialogs/edit.c:99 #: src/globhist/dialogs.c:232 src/protocol/auth/dialogs.c:264 msgid "C~lear" msgstr "Wy~czy¶æ" -#: src/cookies/dialogs.c:484 +#: src/cookies/dialogs.c:500 msgid "Cookie manager" msgstr "Menad¿er ciasteczek" @@ -4983,7 +4910,7 @@ msgstr "Wewn msgid "No header info." msgstr "Brak nag³ówka." -#: src/dialogs/download.c:243 src/dialogs/menu.c:593 +#: src/dialogs/download.c:243 src/dialogs/menu.c:597 #: src/protocol/bittorrent/dialogs.c:228 src/session/download.c:398 msgid "Download" msgstr "Pobieranie" @@ -5205,9 +5132,9 @@ msgstr[2] "%ld sformatowanych" #, c-format msgid "%ld refreshing" msgid_plural "%ld refreshing" -msgstr[0] "%ld od¶wie¿anych" -msgstr[1] "%ld od¶wie¿any" -msgstr[2] "%ld od¶wie¿ane" +msgstr[0] "%ld od¶wie¿any" +msgstr[1] "%ld od¶wie¿ane" +msgstr[2] "%ld od¶wie¿anych" #: src/dialogs/info.c:236 msgid "Interlinking" @@ -5253,402 +5180,402 @@ msgstr[2] "%ld bajt msgid "Save URL" msgstr "Zapisz URL" -#: src/dialogs/menu.c:96 src/dialogs/menu.c:537 +#: src/dialogs/menu.c:96 src/dialogs/menu.c:541 msgid "Enter URL" msgstr "Wprowad¼ URL" -#: src/dialogs/menu.c:121 +#: src/dialogs/menu.c:125 msgid "Exit ELinks" msgstr "Wyjd¼ z ELinksa" -#: src/dialogs/menu.c:123 +#: src/dialogs/menu.c:127 msgid "Do you really want to exit ELinks (and terminate all downloads)?" msgstr "Czy na pewno chcesz wyj¶æ i przerwaæ wszystkie ¶ci±gania?" -#: src/dialogs/menu.c:125 +#: src/dialogs/menu.c:129 msgid "Do you really want to exit ELinks?" msgstr "Czy na pewno chcesz wyj¶æ z ELinksa?" -#: src/dialogs/menu.c:161 +#: src/dialogs/menu.c:165 msgid "No history" msgstr "Brak historii" #. accelerator_context(src/dialogs/menu.c:file_menu, tab_menu) -#: src/dialogs/menu.c:233 src/dialogs/menu.c:309 +#: src/dialogs/menu.c:237 src/dialogs/menu.c:313 msgid "Go ~back" msgstr "~Wróæ" #. accelerator_context(tab_menu) -#: src/dialogs/menu.c:234 +#: src/dialogs/menu.c:238 msgid "Go for~ward" msgstr "Naprzó~d" #. accelerator_context(src/dialogs/menu.c:file_menu, tab_menu) -#: src/dialogs/menu.c:241 src/dialogs/menu.c:322 +#: src/dialogs/menu.c:245 src/dialogs/menu.c:326 msgid "Bookm~ark document" msgstr "Dodaj doku~ment do zak³adek" #. accelerator_context(src/dialogs/menu.c:view_menu, tab_menu) -#: src/dialogs/menu.c:245 src/dialogs/menu.c:414 +#: src/dialogs/menu.c:249 src/dialogs/menu.c:418 msgid "Toggle ~html/plain" msgstr "Prze³±cz ~html/plain" #. accelerator_context(tab_menu) -#: src/dialogs/menu.c:246 +#: src/dialogs/menu.c:250 msgid "~Reload" msgstr "P~rze³aduj" #. accelerator_context(src/dialogs/menu.c:view_menu, tab_menu) -#: src/dialogs/menu.c:249 src/dialogs/menu.c:424 +#: src/dialogs/menu.c:253 src/dialogs/menu.c:428 msgid "Frame at ~full-screen" msgstr "Ramka na ~ca³ym ekranie" #. accelerator_context(tab_menu) -#: src/dialogs/menu.c:251 +#: src/dialogs/menu.c:255 msgid "~Pass frame URI to external command" msgstr "Przeka¿ ~URI ramki do zewnêtrznego polecenia" #. accelerator_context(src/dialogs/menu.c:view_menu, tab_menu) -#: src/dialogs/menu.c:259 src/dialogs/menu.c:426 +#: src/dialogs/menu.c:263 src/dialogs/menu.c:430 msgid "Nex~t tab" msgstr "Nas~têpna karta" #. accelerator_context(src/dialogs/menu.c:view_menu, tab_menu) -#: src/dialogs/menu.c:260 src/dialogs/menu.c:427 +#: src/dialogs/menu.c:264 src/dialogs/menu.c:431 msgid "Pre~v tab" msgstr "Poprzednia ~karta" #. accelerator_context(src/dialogs/menu.c:view_menu, tab_menu) -#: src/dialogs/menu.c:263 src/dialogs/menu.c:428 +#: src/dialogs/menu.c:267 src/dialogs/menu.c:432 msgid "~Close tab" msgstr "~Zamknij kartê" #. accelerator_context(tab_menu) -#: src/dialogs/menu.c:266 +#: src/dialogs/menu.c:270 msgid "C~lose all tabs but the current" msgstr "Z~amknij wszystkie karty za wyj±tkiem bie¿±cej" # #. accelerator_context(tab_menu) -#: src/dialogs/menu.c:270 +#: src/dialogs/menu.c:274 msgid "B~ookmark all tabs" msgstr "Zapisz ~informacje o wszystkich kartach" #. accelerator_context(tab_menu) -#: src/dialogs/menu.c:278 +#: src/dialogs/menu.c:282 msgid "Pass tab URI to e~xternal command" msgstr "~Przeka¿ URI karty do zewnêtrznego polecenia" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:306 +#: src/dialogs/menu.c:310 msgid "Open new ~tab" msgstr "Otwó~rz w nowej karcie" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:307 +#: src/dialogs/menu.c:311 msgid "Open new tab in backgroun~d" msgstr "Otwórz now± kartê w t~le" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:308 +#: src/dialogs/menu.c:312 msgid "~Go to URL" msgstr "Przejd¼ do ~URL-a" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:310 +#: src/dialogs/menu.c:314 msgid "Go ~forward" msgstr "Naprzó~d" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:311 +#: src/dialogs/menu.c:315 msgid "~History" msgstr "~Historia" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:312 +#: src/dialogs/menu.c:316 msgid "~Unhistory" msgstr "Historia ~powrotów" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:318 +#: src/dialogs/menu.c:322 msgid "~Save as" msgstr "Zapi~sz jako" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:319 +#: src/dialogs/menu.c:323 msgid "Save UR~L as" msgstr "Zapisz URL ~jako" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:320 +#: src/dialogs/menu.c:324 msgid "Sa~ve formatted document" msgstr "Zapisz s~formatowany dokument" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:329 +#: src/dialogs/menu.c:333 msgid "~Kill background connections" msgstr "Przerwij wszyst~kie po³±czenia w tle" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:330 +#: src/dialogs/menu.c:334 msgid "Flush all ~caches" msgstr "Wyczy¶æ ~ca³± pamiêæ podrêczn±" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:331 +#: src/dialogs/menu.c:335 msgid "Resource ~info" msgstr "~Informacje o zasobach" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:338 +#: src/dialogs/menu.c:342 msgid "E~xit" msgstr "W~yj¶cie" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:365 +#: src/dialogs/menu.c:369 msgid "Open ~new window" msgstr "Otwórz ~nowe okno" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:384 +#: src/dialogs/menu.c:388 msgid "~OS shell" msgstr "P~ow³oka systemowa" #. accelerator_context(src/dialogs/menu.c:file_menu) -#: src/dialogs/menu.c:391 +#: src/dialogs/menu.c:395 msgid "Resize t~erminal" msgstr "Zmieñ rozmiar ~terminala" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:409 +#: src/dialogs/menu.c:413 msgid "Search ~backward" msgstr "Szukaj ~wstecz" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:410 +#: src/dialogs/menu.c:414 msgid "Find ~next" msgstr "Znajd¼ ~nastêpne" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:411 +#: src/dialogs/menu.c:415 msgid "Find ~previous" msgstr "Znajd¼ ~poprzednie" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:412 +#: src/dialogs/menu.c:416 msgid "T~ypeahead search" msgstr "Szukanie z w~yprzedzeniem" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:415 +#: src/dialogs/menu.c:419 msgid "Toggle i~mages" msgstr "Prze³±cz ~obrazki" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:416 +#: src/dialogs/menu.c:420 msgid "Toggle ~link numbering" msgstr "Prze³±cz n~umerowanie odno¶ników" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:417 +#: src/dialogs/menu.c:421 msgid "Toggle ~document colors" msgstr "Prze³±cz sposób u¿ycia kolorów podanych w ~dokumencie" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:418 +#: src/dialogs/menu.c:422 msgid "~Wrap text on/off" msgstr "Zawi~janie tekstu w³/wy³" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:420 +#: src/dialogs/menu.c:424 msgid "Document ~info" msgstr "~Informacje o dokumencie" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:421 +#: src/dialogs/menu.c:425 msgid "H~eader info" msgstr "Informacj~e o nag³ówku" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:422 +#: src/dialogs/menu.c:426 msgid "Rel~oad document" msgstr "P~rze³aduj dokument" #. accelerator_context(src/dialogs/menu.c:view_menu) -#: src/dialogs/menu.c:423 +#: src/dialogs/menu.c:427 msgid "~Rerender document" msgstr "Prze~formatuj dokument" #. accelerator_context(src/dialogs/menu.c:help_menu) -#: src/dialogs/menu.c:435 +#: src/dialogs/menu.c:439 msgid "~ELinks homepage" msgstr "Strona domowa ~ELinksa" # #. accelerator_context(src/dialogs/menu.c:help_menu) -#: src/dialogs/menu.c:436 +#: src/dialogs/menu.c:440 msgid "~Documentation" msgstr "~Dokumentacja" #. accelerator_context(src/dialogs/menu.c:help_menu) -#: src/dialogs/menu.c:437 +#: src/dialogs/menu.c:441 msgid "~Keys" msgstr "~Klawiszologia" #. accelerator_context(src/dialogs/menu.c:help_menu) -#: src/dialogs/menu.c:439 +#: src/dialogs/menu.c:443 msgid "LED ~indicators" msgstr "Wska¼n~iki LED" #. accelerator_context(src/dialogs/menu.c:help_menu) -#: src/dialogs/menu.c:442 +#: src/dialogs/menu.c:446 msgid "~Bugs information" msgstr "Informacje o ~b³êdach" #. accelerator_context(src/dialogs/menu.c:help_menu) -#: src/dialogs/menu.c:444 +#: src/dialogs/menu.c:448 msgid "ELinks ~GITWeb" msgstr "ELinks ~GITWeb" #. accelerator_context(src/dialogs/menu.c:help_menu) -#: src/dialogs/menu.c:447 +#: src/dialogs/menu.c:451 msgid "~Copying" msgstr "Ko~piowanie" #. accelerator_context(src/dialogs/menu.c:help_menu) -#: src/dialogs/menu.c:448 +#: src/dialogs/menu.c:452 msgid "~About" msgstr "~O programie" #. accelerator_context(src/dialogs/menu.c:ext_menu) -#: src/dialogs/menu.c:456 +#: src/dialogs/menu.c:460 msgid "~Modify" msgstr "~Zmieñ" #. accelerator_context(src/dialogs/menu.c:setup_menu) -#: src/dialogs/menu.c:464 src/dialogs/menu.c:478 +#: src/dialogs/menu.c:468 src/dialogs/menu.c:482 msgid "~Language" msgstr "~Jêzyk" #. accelerator_context(src/dialogs/menu.c:setup_menu) -#: src/dialogs/menu.c:466 src/dialogs/menu.c:479 +#: src/dialogs/menu.c:470 src/dialogs/menu.c:483 msgid "C~haracter set" msgstr "~Zestaw znaków" #. accelerator_context(src/dialogs/menu.c:setup_menu) -#: src/dialogs/menu.c:467 src/dialogs/menu.c:480 +#: src/dialogs/menu.c:471 src/dialogs/menu.c:484 msgid "~Terminal options" msgstr "Opcje ~terminala" #. accelerator_context(src/dialogs/menu.c:setup_menu) -#: src/dialogs/menu.c:468 +#: src/dialogs/menu.c:472 msgid "File ~extensions" msgstr "~Rozszerzenia" #. accelerator_context(src/dialogs/menu.c:setup_menu) -#: src/dialogs/menu.c:470 +#: src/dialogs/menu.c:474 msgid "~Options manager" msgstr "Menad¿er ~ustawieñ" #. accelerator_context(src/dialogs/menu.c:setup_menu) -#: src/dialogs/menu.c:471 +#: src/dialogs/menu.c:475 msgid "~Keybinding manager" msgstr "Menad¿er przypisañ ~klawiszy" #. accelerator_context(src/dialogs/menu.c:setup_menu) -#: src/dialogs/menu.c:472 +#: src/dialogs/menu.c:476 msgid "~Save options" msgstr "Zapisz ~opcje" #. accelerator_context(src/dialogs/menu.c:tools_menu) -#: src/dialogs/menu.c:487 +#: src/dialogs/menu.c:491 msgid "Global ~history" msgstr "Historia ~globalna" # #. accelerator_context(src/dialogs/menu.c:tools_menu) -#: src/dialogs/menu.c:490 +#: src/dialogs/menu.c:494 msgid "~Bookmarks" msgstr "~Zak³adki" # #. accelerator_context(src/dialogs/menu.c:tools_menu) -#: src/dialogs/menu.c:492 +#: src/dialogs/menu.c:496 msgid "~Cache" msgstr "Pamiêæ podrê~czna" #. accelerator_context(src/dialogs/menu.c:tools_menu) -#: src/dialogs/menu.c:493 +#: src/dialogs/menu.c:497 msgid "~Downloads" msgstr "Po~bieranie" #. accelerator_context(src/dialogs/menu.c:tools_menu) -#: src/dialogs/menu.c:495 +#: src/dialogs/menu.c:499 msgid "Coo~kies" msgstr "Ciastecz~ka" #. accelerator_context(src/dialogs/menu.c:tools_menu) -#: src/dialogs/menu.c:498 +#: src/dialogs/menu.c:502 msgid "~Form history" msgstr "Historia ~formularzy" #. accelerator_context(src/dialogs/menu.c:tools_menu) -#: src/dialogs/menu.c:500 +#: src/dialogs/menu.c:504 msgid "~Authentication" msgstr "~Autentykacja" #. accelerator_context(src/dialogs/menu.c:main_menu) -#: src/dialogs/menu.c:517 +#: src/dialogs/menu.c:521 msgid "~File" msgstr "~Plik" #. accelerator_context(src/dialogs/menu.c:main_menu) -#: src/dialogs/menu.c:518 +#: src/dialogs/menu.c:522 msgid "~View" msgstr "~Widok" #. accelerator_context(src/dialogs/menu.c:main_menu) -#: src/dialogs/menu.c:519 +#: src/dialogs/menu.c:523 msgid "~Link" msgstr "~Odno¶nik" #. accelerator_context(src/dialogs/menu.c:main_menu) -#: src/dialogs/menu.c:520 +#: src/dialogs/menu.c:524 msgid "~Tools" msgstr "~Narzêdzia" #. accelerator_context(src/dialogs/menu.c:main_menu) -#: src/dialogs/menu.c:521 +#: src/dialogs/menu.c:525 msgid "~Setup" msgstr "~Ustawienia" #. accelerator_context(src/dialogs/menu.c:main_menu) -#: src/dialogs/menu.c:522 +#: src/dialogs/menu.c:526 msgid "~Help" msgstr "Po~moc" -#: src/dialogs/menu.c:537 +#: src/dialogs/menu.c:541 msgid "Go to URL" msgstr "Przejd¼ do URL-a" -#: src/dialogs/menu.c:593 +#: src/dialogs/menu.c:597 msgid "Save to file" msgstr "Zapisz do pliku" -#: src/dialogs/menu.c:928 +#: src/dialogs/menu.c:932 msgid "Empty directory" msgstr "Pusty katalog" -#: src/dialogs/menu.c:972 +#: src/dialogs/menu.c:976 msgid "Directories:" msgstr "Katalogi:" -#: src/dialogs/menu.c:985 +#: src/dialogs/menu.c:989 msgid "Files:" msgstr "Pliki:" #. 2 '\n' + 1 '\0' -#: src/dialogs/options.c:173 +#: src/dialogs/options.c:171 #, c-format msgid "" "The environmental variable TERM is set to '%s'.\n" @@ -5665,68 +5592,68 @@ msgstr "" "Pozwala to na konfiguracjê tych ustawieñ dla ka¿dego z\n" "terminali, w których uruchamiasz ELinksa." -#: src/dialogs/options.c:199 +#: src/dialogs/options.c:197 msgid "Terminal options" msgstr "Opcje terminala" -#: src/dialogs/options.c:208 +#: src/dialogs/options.c:206 msgid "Frame handling:" msgstr "Rysowanie ramek:" -#: src/dialogs/options.c:209 +#: src/dialogs/options.c:207 msgid "No frames" msgstr "Brak ramek" -#: src/dialogs/options.c:210 +#: src/dialogs/options.c:208 msgid "VT 100 frames" msgstr "Ramki VT100" -#: src/dialogs/options.c:211 +#: src/dialogs/options.c:209 msgid "Linux or OS/2 frames" msgstr "Ramki typu Linux lub OS/2" -#: src/dialogs/options.c:212 +#: src/dialogs/options.c:210 msgid "FreeBSD frames" msgstr "Ramki FreeBSD" -#: src/dialogs/options.c:213 +#: src/dialogs/options.c:211 msgid "KOI8-R frames" msgstr "Ramki KOI8-R" -#: src/dialogs/options.c:215 +#: src/dialogs/options.c:213 msgid "Color mode:" msgstr "Tryb kolorowy:" -#: src/dialogs/options.c:216 +#: src/dialogs/options.c:214 msgid "No colors (mono)" msgstr "Brak kolorów (mono)" -#: src/dialogs/options.c:217 +#: src/dialogs/options.c:215 msgid "16 colors" msgstr "16 kolorów" -#: src/dialogs/options.c:219 +#: src/dialogs/options.c:217 msgid "88 colors" msgstr "88 kolorów" -#: src/dialogs/options.c:222 +#: src/dialogs/options.c:220 msgid "256 colors" msgstr "256 kolorów" # -#: src/dialogs/options.c:225 +#: src/dialogs/options.c:223 msgid "true color" msgstr "kolor 24-bitowy" -#: src/dialogs/options.c:309 +#: src/dialogs/options.c:307 msgid "Resize terminal" msgstr "Zmieñ rozmiar terminala" -#: src/dialogs/options.c:312 +#: src/dialogs/options.c:310 msgid "Width=" msgstr "Szeroko¶æ=" -#: src/dialogs/options.c:313 +#: src/dialogs/options.c:311 msgid "Height=" msgstr "Wysoko¶æ=" @@ -5789,55 +5716,57 @@ msgstr "pozosta msgid "ETA" msgstr "ETA" -#: src/dialogs/status.c:184 +#: src/dialogs/status.c:185 +#, c-format msgid "Enter a mark to set" msgstr "Ustaw zaznaczenie" -#: src/dialogs/status.c:188 +#: src/dialogs/status.c:189 +#, c-format msgid "Enter a mark to which to jump" msgstr "Wprowad¼ zaznaczenie, do którego skoczyæ" -#: src/dialogs/status.c:195 +#: src/dialogs/status.c:196 #, c-format msgid "Keyboard prefix: %d" msgstr "Prefix klawiatury: %d" -#: src/dialogs/status.c:225 +#: src/dialogs/status.c:226 #, c-format msgid "Cursor position: %dx%d" msgstr "Pozycja kursora: %dx%d" -#: src/dialogs/status.c:325 +#: src/dialogs/status.c:326 msgid "Untitled" msgstr "Bez tytu³u" -#: src/dialogs/status.c:327 +#: src/dialogs/status.c:328 msgid "No document" msgstr "Brak dokumentu" #. name: -#: src/document/css/css.c:28 src/document/css/css.c:155 +#: src/document/css/css.c:29 src/document/css/css.c:159 msgid "Cascading Style Sheets" msgstr "Kaskadowe szablony stylów CSS" -#: src/document/css/css.c:30 +#: src/document/css/css.c:31 msgid "Options concerning how to use CSS for styling documents." msgstr "Ustawienia dotycz±ce u¿ycia CSS do stylizacji dokumentów." # -#: src/document/css/css.c:32 +#: src/document/css/css.c:33 msgid "Enable CSS" msgstr "W³±cz CSS" -#: src/document/css/css.c:34 +#: src/document/css/css.c:35 msgid "Enable adding of CSS style info to documents." msgstr "W³±cza dodawanie stylów CSS do dokumentu." -#: src/document/css/css.c:36 +#: src/document/css/css.c:37 msgid "Import external style sheets" msgstr "Importowanie zewnêtrznych szablonów stylów" -#: src/document/css/css.c:38 +#: src/document/css/css.c:39 msgid "" "When enabled any external style sheets that are imported from\n" "either CSS itself using the @import keyword or from the HTML using\n" @@ -5847,11 +5776,11 @@ msgstr "" "przy u¿yciu s³owa kluczowego @import albo z dokumentu HTML\n" "u¿ywaj±c tagu tak¿e bêd± pobrane." -#: src/document/css/css.c:42 +#: src/document/css/css.c:43 msgid "Default style sheet" msgstr "Domy¶lny szablon stylów" -#: src/document/css/css.c:44 +#: src/document/css/css.c:45 msgid "" "The path to the file containing the default user defined\n" "Cascading Style Sheet. It can be used to control the basic\n" @@ -5866,7 +5795,7 @@ msgstr "" "Zostaw jako \"\", ¿eby u¿ywaæ wbudowanych styli dokumentu." #. name: -#: src/ecmascript/ecmascript.c:41 src/ecmascript/ecmascript.c:345 +#: src/ecmascript/ecmascript.c:41 src/ecmascript/ecmascript.c:348 msgid "ECMAScript" msgstr "ECMAScript" @@ -5932,7 +5861,12 @@ msgstr "" "b³±d i mo¿e to spowodowaæ zastopowanie ca³ego ELinksa.\n" "Wykonywanie skryptu zosta³o przerwane." -#: src/ecmascript/see/window.c:224 src/ecmascript/spidermonkey/window.c:331 +#. name: +#: src/ecmascript/see.c:184 +msgid "SEE" +msgstr "SEE" + +#: src/ecmascript/see/window.c:227 src/ecmascript/spidermonkey/window.c:331 msgid "JavaScript Alert" msgstr "Alert JavaScriptu" @@ -5945,6 +5879,11 @@ msgstr "Skrypt zawarty w bie msgid "JavaScript Error" msgstr "B³±d JavaScriptu" +#. name: +#: src/ecmascript/spidermonkey.c:315 +msgid "SpiderMonkey" +msgstr "SpiderMonkey" + #: src/formhist/dialogs.c:67 msgid "Forms are never saved for this URL." msgstr "Formularze dla tego URL-a nie s± zapisywane." @@ -6042,11 +5981,11 @@ msgstr "" "do pliku czy nie. Opcja ta jedynie wy³±cza okno dialogowe,\n" "poprzednio zapisane formularze logowania pozostaj± nienaruszone." -#: src/formhist/formhist.c:413 +#: src/formhist/formhist.c:426 msgid "Form history" msgstr "Historia formularzy" -#: src/formhist/formhist.c:414 +#: src/formhist/formhist.c:427 msgid "" "Should this login be remembered?\n" "\n" @@ -6063,12 +6002,12 @@ msgstr "" "Je¶li u¿ywasz istotnych hase³ odpowiedz NIE." #. accelerator_context(memorize_form) -#: src/formhist/formhist.c:421 +#: src/formhist/formhist.c:434 msgid "Ne~ver for this site" msgstr "Nigdy dla tego ~miejsca" #. name: -#: src/formhist/formhist.c:440 +#: src/formhist/formhist.c:453 msgid "Form History" msgstr "Historia formularzy" @@ -6165,7 +6104,7 @@ msgstr "" "1 - tytu³y stron" #. name: -#: src/globhist/globhist.c:448 +#: src/globhist/globhist.c:451 msgid "Global History" msgstr "Historia globalna" @@ -6305,12 +6244,13 @@ msgstr "Turecki" msgid "Ukrainian" msgstr "Ukraiñski" -#: src/main/interlink.c:329 src/main/select.c:257 +#: src/main/interlink.c:329 src/main/select.c:261 #, c-format msgid "The call to %s failed: %d (%s)" msgstr "Wywo³anie %s nieudane: %d (%s)" #: src/main/main.c:136 +#, c-format msgid "Cannot create a pipe for internal communication." msgstr "Nie mo¿na utworzyæ potoku dla wewnêtrznej komunikacji." @@ -6320,24 +6260,28 @@ msgid "URL expected after -%s" msgstr "Spodziewany URL po -%s" #: src/main/main.c:210 +#, c-format msgid "No running ELinks found." msgstr "Nie znaleziono ¿adnego dzia³aj±cego ELinksa." #. The remote session(s) can not be created #: src/main/main.c:216 +#, c-format msgid "No remote session to connect to." msgstr "Brak zdalnej sesji, ¿eby siê przy³±czyæ." #: src/main/main.c:224 +#, c-format msgid "Unable to encode session info." msgstr "Nie jestem w stanie zdekodowaæ informacji o sesji." #: src/main/main.c:241 +#, c-format msgid "Unable to attach_terminal()." msgstr "Nie jestem w stanie przy³±czyæ terminala." #. Infinite loop prevention. -#: src/main/select.c:260 +#: src/main/select.c:264 #, c-format msgid "%d select() failures." msgstr "%d b³êdów select()." @@ -6620,7 +6564,7 @@ msgid "No extensions" msgstr "Brak rozszerzeñ" #. name: -#: src/mime/mime.c:38 src/mime/mime.c:359 +#: src/mime/mime.c:38 src/mime/mime.c:360 msgid "MIME" msgstr "MIME" @@ -6701,113 +6645,113 @@ msgstr "SSL" msgid "SSL options." msgstr "Ustawienia SSL." -#: src/network/state.c:26 +#: src/network/state.c:27 msgid "Waiting in queue" msgstr "Oczekuj±ce w kolejce" -#: src/network/state.c:27 +#: src/network/state.c:28 msgid "Looking up host" msgstr "Szukam serwera" -#: src/network/state.c:28 +#: src/network/state.c:29 msgid "Making connection" msgstr "Nawi±zywanie po³±czenia" -#: src/network/state.c:29 +#: src/network/state.c:30 msgid "SSL negotiation" msgstr "Negocjacja SSL" -#: src/network/state.c:30 +#: src/network/state.c:31 msgid "Request sent" msgstr "Zapytanie wys³ane" -#: src/network/state.c:31 +#: src/network/state.c:32 msgid "Logging in" msgstr "Logujê siê" -#: src/network/state.c:32 +#: src/network/state.c:33 msgid "Getting headers" msgstr "Pobieranie nag³ówków" -#: src/network/state.c:33 +#: src/network/state.c:34 msgid "Server is processing request" msgstr "Serwer przetwarza zapytanie" -#: src/network/state.c:34 +#: src/network/state.c:35 msgid "Transferring" msgstr "Przesy³anie" -#: src/network/state.c:36 +#: src/network/state.c:37 msgid "Resuming" msgstr "Wznawianie" # -#: src/network/state.c:37 +#: src/network/state.c:38 msgid "Connecting to peers" msgstr "£±czenie z partnerami" # -#: src/network/state.c:38 +#: src/network/state.c:39 msgid "Connecting to tracker" msgstr "£±czenie siê z trackerem" -#: src/network/state.c:41 +#: src/network/state.c:42 msgid "Waiting for redirect confirmation" msgstr "Oczekiwanie na potwierdzenie przekierowania" -#: src/network/state.c:42 +#: src/network/state.c:43 msgid "OK" msgstr "OK" -#: src/network/state.c:43 +#: src/network/state.c:44 msgid "Interrupted" msgstr "Przerwano" -#: src/network/state.c:44 +#: src/network/state.c:45 msgid "Socket exception" msgstr "B³±d gniazda" -#: src/network/state.c:45 src/scripting/python/dialogs.c:59 +#: src/network/state.c:46 src/scripting/python/dialogs.c:59 #: src/scripting/python/dialogs.c:188 src/scripting/python/keybinding.c:98 #: src/scripting/python/load.c:113 src/scripting/python/menu.c:98 #: src/scripting/python/open.c:59 msgid "Internal error" msgstr "B³±d wewnêtrzny" -#: src/network/state.c:48 +#: src/network/state.c:49 msgid "Error writing to socket" msgstr "B³±d przy zapisywaniu do gniazda" -#: src/network/state.c:49 +#: src/network/state.c:50 msgid "Error reading from socket" msgstr "B³±d przy czytaniu z gniazda" -#: src/network/state.c:50 +#: src/network/state.c:51 msgid "Data modified" msgstr "Dane zosta³y zmodyfikowane" -#: src/network/state.c:51 src/scripting/python/load.c:119 +#: src/network/state.c:52 src/scripting/python/load.c:119 #: src/scripting/python/open.c:65 msgid "Bad URL syntax" msgstr "Z³a sk³adnia URL-a" -#: src/network/state.c:53 +#: src/network/state.c:54 msgid "Request must be restarted" msgstr "Zapytanie musi byæ powtórzone" -#: src/network/state.c:54 +#: src/network/state.c:55 msgid "Can't get socket state" msgstr "Nie mo¿na zbadaæ stanu gniazda" -#: src/network/state.c:55 +#: src/network/state.c:56 msgid "Only local connections are permitted" msgstr "Dozwolone s± tylko lokalne po³±czenia" -#: src/network/state.c:56 +#: src/network/state.c:57 msgid "No host in the specified IP family was found" msgstr "Nie znaleziono hosta w podanej rodzinie adresów IP" -#: src/network/state.c:58 +#: src/network/state.c:59 msgid "" "Error while decoding file. This might be caused\n" "by the encoded file being corrupt." @@ -6815,7 +6759,7 @@ msgstr "" "B³±d podczas dekodowania pliku. Powodem mo¿e byæ\n" "uszkodzony plik." -#: src/network/state.c:61 +#: src/network/state.c:62 msgid "" "This URL contains a protocol not yet known by ELinks.\n" "You can configure an external handler for it through\n" @@ -6825,7 +6769,7 @@ msgstr "" "Mo¿esz skonfigurowaæ zewnêtrzny program obs³ugi dla niego\n" "przy u¿yciu menad¿era ustawieñ." -#: src/network/state.c:65 +#: src/network/state.c:66 msgid "" "This URL contains a protocol that is not natively known\n" "by ELinks which means that ELinks relies on external\n" @@ -6837,71 +6781,71 @@ msgstr "" "programie do jego obs³ugi. ¦ci±ganie URLi za pomoc±\n" "zewnêtrznych programów nie jest w tej chwili wspierane." -#: src/network/state.c:70 +#: src/network/state.c:71 msgid "Bad HTTP response" msgstr "Nieprawid³owa odpowied¼ HTTP" -#: src/network/state.c:71 +#: src/network/state.c:72 msgid "No content" msgstr "Brak zawarto¶ci" -#: src/network/state.c:73 +#: src/network/state.c:74 msgid "Unknown file type" msgstr "Nieznany typ pliku" -#: src/network/state.c:74 +#: src/network/state.c:75 msgid "Error opening file" msgstr "B³±d przy otwieraniu pliku" -#: src/network/state.c:75 +#: src/network/state.c:76 msgid "CGI script not in CGI path" msgstr "Skrypt CGI nie znajduje siê na ¶cie¿ce CGI" -#: src/network/state.c:76 +#: src/network/state.c:77 msgid "Local file access is not allowed in anonymous mode" msgstr "Dostêp do lokalnych plików nie jest mo¿liwy w trybie anonimowym" -#: src/network/state.c:79 +#: src/network/state.c:80 msgid "Bad FTP response" msgstr "Nieprawid³owa odpowied¼ FTP" -#: src/network/state.c:80 +#: src/network/state.c:81 msgid "FTP service unavailable" msgstr "Us³uga FTP jest niedostêpna" -#: src/network/state.c:81 +#: src/network/state.c:82 msgid "Bad FTP login" msgstr "Nieprawid³owy login" -#: src/network/state.c:82 +#: src/network/state.c:83 msgid "FTP PORT command failed" msgstr "Polecenie PORT nie powiod³o siê" -#: src/network/state.c:83 +#: src/network/state.c:84 msgid "File not found" msgstr "Nie znaleziono pliku" -#: src/network/state.c:84 +#: src/network/state.c:85 msgid "FTP file error" msgstr "B³±d plikowy FTP" -#: src/network/state.c:88 +#: src/network/state.c:89 msgid "SSL error" msgstr "B³±d SSL" -#: src/network/state.c:90 +#: src/network/state.c:91 msgid "This version of ELinks does not contain SSL/TLS support" msgstr "Ta wersja ELinksa nie zawiera wsparcia dla SSL/TSL" -#: src/network/state.c:93 +#: src/network/state.c:94 msgid "JavaScript support is not enabled" msgstr "Obs³uga JavaScriptu nie jest w³±czona." -#: src/network/state.c:96 +#: src/network/state.c:97 msgid "Bad NNTP response" msgstr "Nieprawid³owa odpowied¼ NNTP" -#: src/network/state.c:97 +#: src/network/state.c:98 msgid "" "Unable to handle news: URI because no news server has been\n" "been configured. Either set the option protocol.nntp.server\n" @@ -6911,35 +6855,35 @@ msgstr "" "niusów nie zosta³ skonfigurowany. Ustaw opcjê\n" "protocol.nntp.server albo ustaw zmienn± ¶rodowiskow± NNTPSERVER." -#: src/network/state.c:100 +#: src/network/state.c:101 msgid "Server hang up for some reason" msgstr "Serwer roz³±czy³ siê z nieznanego powodu" -#: src/network/state.c:101 +#: src/network/state.c:102 msgid "No such newsgroup" msgstr "Brak podanej grupy" -#: src/network/state.c:102 +#: src/network/state.c:103 msgid "No such article" msgstr "Brak takiego artyku³u" -#: src/network/state.c:103 +#: src/network/state.c:104 msgid "Transfer failed" msgstr "Transfer zakoñczony niepowodzeniem" -#: src/network/state.c:104 +#: src/network/state.c:105 msgid "Authorization required" msgstr "Potrzebne uwierzytelnienie" -#: src/network/state.c:105 +#: src/network/state.c:106 msgid "Access to server denied" msgstr "Dostêp do serwera zabroniony" -#: src/network/state.c:109 +#: src/network/state.c:110 msgid "The CSO phone-book protocol is not supported." msgstr "Protokó³ CSO phone-book nie jest obs³ugiwany." -#: src/network/state.c:112 +#: src/network/state.c:113 msgid "" "Configuration of the proxy server failed.\n" "This might be caused by an incorrect proxy\n" @@ -6959,23 +6903,23 @@ msgstr "" "oraz (opcjonalnie) dwukropek i numer portu.\n" "Przyk³ad: 'localhost:8080'." -#: src/network/state.c:122 +#: src/network/state.c:123 msgid "BitTorrent error" msgstr "B³±d BitTorrenta" -#: src/network/state.c:123 +#: src/network/state.c:124 msgid "The BitTorrent metainfo file contained errors" msgstr "Plik metainformacji BitTorrent zawiera b³êdy" -#: src/network/state.c:124 +#: src/network/state.c:125 msgid "The tracker requesting failed" msgstr "Zapytanie dotycz±ce ¶ledzenia nie powiod³o siê" -#: src/network/state.c:125 +#: src/network/state.c:126 msgid "The BitTorrent URL does not point to a valid URL" msgstr "URL BitTorrenta nie wskazuje na prawid³owy URL" -#: src/network/state.c:149 +#: src/network/state.c:150 msgid "Unknown error" msgstr "Nieznany b³±d" @@ -7009,6 +6953,11 @@ msgstr "~Pe msgid "~BeOS terminal" msgstr "Terminal ~BeOS" +#. name: +#: src/protocol/auth/auth.c:332 +msgid "Authentication" +msgstr "Autentykacja" + #: src/protocol/auth/dialogs.c:87 #, c-format msgid "Authentication required for %s at %s" @@ -7111,7 +7060,7 @@ msgstr "Zakres port #: src/protocol/bittorrent/bittorrent.c:36 msgid "Port range allowed to be used for listening on." -msgstr "Zakres portów na którym mo¿na nas³uchiwaæ" +msgstr "Zakres portów na którym mo¿na nas³uchiwaæ." #: src/protocol/bittorrent/bittorrent.c:38 msgid "Minimum port" @@ -7119,7 +7068,7 @@ msgstr "Minimalny numer port #: src/protocol/bittorrent/bittorrent.c:40 msgid "The minimum port to try and listen on." -msgstr "Minimalny numer portu do nas³uchiwania" +msgstr "Minimalny numer portu do nas³uchiwania." # #: src/protocol/bittorrent/bittorrent.c:42 @@ -7197,10 +7146,10 @@ msgid "" "be sent to the tracker." msgstr "" "Dodatkowa identyfikacja nie wspó³dzielona z ¿adnymi u¿ytkownikami.\n" -"Ma s³u¿yæ aby umo¿liwiæ klientom udowodnienie swojej to¿samo¶ci po\n" -"zmianie adresu IP. Jest to parametr opcjonalny, ale niektóre trackery\n" +"Umo¿liwia klientom udowodnienie swojej to¿samo¶ci po zmianie\n" +"adresu IP. Jest to parametr opcjonalny, ale niektóre trackery\n" "wymagaj± tego parametru. W przypadku ustawienia na \"\" ¿aden klucz\n" -"u¿ytkownika nie bêdzie wysy³any do trackera" +"u¿ytkownika nie bêdzie wysy³any do trackera." #: src/protocol/bittorrent/bittorrent.c:81 msgid "Maximum number of peers to request" @@ -7244,7 +7193,7 @@ msgstr "Niskopoziomowe opcje peer-wire." #: src/protocol/bittorrent/bittorrent.c:102 msgid "Maximum number of peer connections" -msgstr "Maksymalna liczba po³±czeñ z partnerami." +msgstr "Maksymalna liczba po³±czeñ z partnerami" #: src/protocol/bittorrent/bittorrent.c:104 msgid "" @@ -7671,7 +7620,7 @@ msgstr[0] "%u niedost msgstr[1] "%u niedostêpne" msgstr[2] "%u niedostêpnych" -#: src/protocol/bittorrent/dialogs.c:584 src/session/session.c:281 +#: src/protocol/bittorrent/dialogs.c:584 src/session/session.c:276 #, c-format msgid "Unable to retrieve %s" msgstr "Nie mo¿na odebraæ %s" @@ -7685,7 +7634,7 @@ msgstr "Co chcesz zrobi msgid "Information about the torrent" msgstr "Informacje o potoku" -#: src/protocol/bittorrent/dialogs.c:774 src/session/download.c:1121 +#: src/protocol/bittorrent/dialogs.c:774 src/session/download.c:1144 msgid "What to do?" msgstr "Co mam zrobiæ?" @@ -7695,12 +7644,12 @@ msgid "Down~load" msgstr "~Pobierz" #. accelerator_context(src/protocol/bittorrent/dialogs.c:bittorrent_query_callback, src/session/download.c:do_type_query) -#: src/protocol/bittorrent/dialogs.c:802 src/session/download.c:1233 +#: src/protocol/bittorrent/dialogs.c:802 src/session/download.c:1256 msgid "~Display" msgstr "~Wy¶wietl" #. accelerator_context(src/protocol/bittorrent/dialogs.c:bittorrent_query_callback, src/session/download.c:do_type_query) -#: src/protocol/bittorrent/dialogs.c:806 src/session/download.c:1237 +#: src/protocol/bittorrent/dialogs.c:806 src/session/download.c:1260 msgid "Show ~header" msgstr "Poka¿ ~nag³ówek" @@ -7793,19 +7742,19 @@ msgid "Finger" msgstr "Finger" #. name: -#: src/protocol/fsp/fsp.c:44 src/protocol/fsp/fsp.c:56 +#: src/protocol/fsp/fsp.c:45 src/protocol/fsp/fsp.c:57 msgid "FSP" msgstr "FSP" -#: src/protocol/fsp/fsp.c:46 +#: src/protocol/fsp/fsp.c:47 msgid "FSP specific options." msgstr "Opcje dotycz±ce protoko³u FSP." -#: src/protocol/fsp/fsp.c:48 +#: src/protocol/fsp/fsp.c:49 msgid "Sort entries" msgstr "Sortowanie elementów" -#: src/protocol/fsp/fsp.c:50 +#: src/protocol/fsp/fsp.c:51 msgid "Whether to sort entries in directory listings." msgstr "Czy sortowaæ elementy przy wy¶wietlaniu katalogów." @@ -7870,16 +7819,17 @@ msgstr "U msgid "Gopher" msgstr "Gopher" -#: src/protocol/http/codes.c:104 +#: src/protocol/http/codes.c:105 #, c-format msgid "HTTP error %03d" msgstr "B³±d HTTP %03d" -#: src/protocol/http/codes.c:127 +#: src/protocol/http/codes.c:128 +#, c-format msgid "" " An error occurred on the server while fetching the document you\n" " requested. However, the server did not send back any explanation of what\n" -" happenned, so it is unknown what went wrong. Please contact the web\n" +" happened, so it is unknown what went wrong. Please contact the web\n" " server administrator about this, if you believe that this error should\n" " not occur since it is not a nice behaviour from the web server at all\n" " and indicates that there is some much deeper problem with the web server\n" @@ -8298,41 +8248,49 @@ msgstr "" msgid "Default template" msgstr "Domy¶lny szablon" -#: src/protocol/rewrite/rewrite.c:95 +#: src/protocol/rewrite/rewrite.c:96 +#, no-c-format msgid "" "Default URI template used when the string entered in\n" "the goto dialog does not appear to be a URI or a filename\n" "(i.e. contains no '.', ':' or '/' characters), and does\n" "not match any defined prefixes. Set the value to \"\" to\n" -"disable use of the default template rewrite rule." +"disable use of the default template rewrite rule.\n" +"%c in the template means the current URL\n" +"%s in the template means the whole string from the goto dialog\n" +"%0,%1,...,%9 mean the 1st,2nd,...,10th space-delimited part of %s\n" +"%% in the template means '%'" msgstr "" "Domy¶lny szablon URI u¿ywany, kiedy ³añcuch wprowadzony\n" "w okienku \"Przejd¼ do URL-a\" nie jest ani URI ani nazw±\n" "pliku (np. nie zawiera znaków: '.', ':' czy '/')\n" "i nie pasuje do ¿adnego ze zdefiniowanych przedrostków.\n" "Ustaw warto¶æ na \"\", ¿eby wy³±czyæ u¿ycie domy¶lnego\n" -"szablonu regu³y przepisywania." +"szablonu regu³y przepisywania.\n" +"%c w szablonie oznacza bie¿±cy URL\n" +"%s oznacza ca³y ³añcuch z okienka \"Przejd¼ do URL-a\"\n" +"%0, %1, ..., %9 oznacza pierwsz±, drug±, ..., dziesi±t± czê¶æ %s\n" +"%% oznacza '%'" #. name: -#: src/protocol/rewrite/rewrite.c:367 +#: src/protocol/rewrite/rewrite.c:372 msgid "URI rewrite" msgstr "Przepisywanie URI" #. name: -#: src/protocol/smb/smb2.c:43 src/protocol/smb/smb2.c:55 -#: src/protocol/smb/smb.c:70 src/protocol/smb/smb.c:82 +#: src/protocol/smb/smb2.c:43 src/protocol/smb/smb2.c:56 msgid "SMB" msgstr "SMB" -#: src/protocol/smb/smb2.c:45 src/protocol/smb/smb.c:72 +#: src/protocol/smb/smb2.c:45 msgid "SAMBA specific options." msgstr "Opcje dotycz±ce SAMBY." -#: src/protocol/smb/smb2.c:47 src/protocol/smb/smb.c:74 +#: src/protocol/smb/smb2.c:47 msgid "Credentials" msgstr "Dane uwierzytelniaj±ce" -#: src/protocol/smb/smb2.c:49 src/protocol/smb/smb.c:76 +#: src/protocol/smb/smb2.c:49 msgid "Credentials file passed to smbclient via -A option." msgstr "" "Plik z danymi uwierzytelniaj±cymi przekazywany\n" @@ -8381,15 +8339,20 @@ msgstr "" "%s - tytu³ maila (?subject=)\n" "%u - ca³y URL" -#: src/protocol/user.c:263 +#: src/protocol/user.c:276 msgid "No program" msgstr "Nie okre¶lono programu" -#: src/protocol/user.c:265 +#: src/protocol/user.c:278 #, c-format msgid "No program specified for protocol %s." msgstr "Nie okre¶lono programu do obs³ugi protoko³u %s." +#. name: +#: src/scripting/guile/guile.c:16 +msgid "Guile" +msgstr "Guile" + #: src/scripting/lua/core.c:312 src/scripting/python/keybinding.c:151 msgid "Error registering event hook" msgstr "B³±d przy rejestrowaniu zaczepienia zdarzenia" @@ -8398,33 +8361,58 @@ msgstr "B msgid "User dialog" msgstr "Okno dialogowe u¿ytkownika" -#: src/scripting/lua/core.c:742 +#: src/scripting/lua/core.c:740 msgid "Lua Error" msgstr "B³±d Lua" -#: src/scripting/lua/core.c:892 +#: src/scripting/lua/core.c:890 msgid "Lua Console" msgstr "Konsola Lua" -#: src/scripting/lua/core.c:892 +#: src/scripting/lua/core.c:890 msgid "Enter expression" msgstr "Wprowad¼ wyra¿enie" +#. name: +#: src/scripting/lua/lua.c:16 +msgid "Lua" +msgstr "Lua" + +#. name: +#: src/scripting/perl/perl.c:16 +msgid "Perl" +msgstr "Perl" + +#. name: +#: src/scripting/python/python.c:18 +msgid "Python" +msgstr "Python" + #: src/scripting/ruby/core.c:131 src/scripting/ruby/core.c:184 msgid "Ruby Message" msgstr "Wiadomo¶æ Ruby'ego" -#: src/scripting/scripting.c:59 +#. name: +#: src/scripting/ruby/ruby.c:16 +msgid "Ruby" +msgstr "Ruby" + +#: src/scripting/scripting.c:44 +#, c-format +msgid "[%s error] %s" +msgstr "[B³±d %s] %s" + +#: src/scripting/scripting.c:60 #, c-format msgid "An error occurred while running a %s script" msgstr "Wyst±pi³ b³±d przy uruchamianiu skryptu %s" -#: src/scripting/scripting.c:65 +#: src/scripting/scripting.c:66 msgid "Browser scripting error" msgstr "B³±d skryptów przegl±darki" #. name: -#: src/scripting/scripting.c:93 +#: src/scripting/scripting.c:94 msgid "Scripting" msgstr "Skryptowanie" @@ -8432,12 +8420,17 @@ msgstr "Skryptowanie" msgid "User script alert" msgstr "B³±d skryptu u¿ytkownika" +#. name: +#: src/scripting/smjs/smjs.c:16 +msgid "Spidermonkey ECMAScript" +msgstr "ECMAScript Spidermonkey" + #: src/session/download.c:235 src/session/download.c:359 -#: src/session/download.c:591 src/session/download.c:679 +#: src/session/download.c:598 src/session/download.c:686 msgid "Download error" msgstr "B³±d pobierania" -#: src/session/download.c:236 src/session/download.c:680 +#: src/session/download.c:236 src/session/download.c:687 #, c-format msgid "" "Could not create file '%s':\n" @@ -8457,17 +8450,17 @@ msgstr "" "\n" "%s" -#: src/session/download.c:592 +#: src/session/download.c:599 #, c-format msgid "'%s' is a directory." msgstr "'%s' to katalog." # -#: src/session/download.c:626 +#: src/session/download.c:633 msgid "File exists" msgstr "Plik istnieje" -#: src/session/download.c:627 +#: src/session/download.c:634 #, c-format msgid "" "This file already exists:\n" @@ -8483,64 +8476,68 @@ msgstr "" "%s" #. accelerator_context(src/session/download.c:lookup_unique_name) -#: src/session/download.c:634 +#: src/session/download.c:641 msgid "Sa~ve under the alternative name" msgstr "Zap~isz pod alternatywn± nazw±" #. accelerator_context(src/session/download.c:lookup_unique_name) -#: src/session/download.c:635 +#: src/session/download.c:642 msgid "~Overwrite the original file" msgstr "Nadpisz ~oryginalny plik" #. accelerator_context(src/session/download.c:lookup_unique_name) -#: src/session/download.c:636 +#: src/session/download.c:643 msgid "~Resume download of the original file" msgstr "Wznów pobie~ranie oryginalnego pliku" -#: src/session/download.c:1124 +#: src/session/download.c:1147 msgid "Unknown type" msgstr "Nieznany typ" -#: src/session/download.c:1149 +#: src/session/download.c:1172 #, c-format msgid "What would you like to do with the file '%s' (type: %s%s%s)?" msgstr "Co chcesz zrobiæ z plikiem '%s' (typu %s%s%s)?" -#: src/session/download.c:1152 +#: src/session/download.c:1175 #, c-format msgid "What would you like to do with the file (type: %s%s%s)?" msgstr "Co chcesz zrobiæ z plikiem (typu %s%s%s)?" -#: src/session/download.c:1183 +#: src/session/download.c:1206 #, no-c-format msgid "Program ('%' will be replaced by the filename)" msgstr "Program ('%' zostanie zast±pione nazw± pliku)" -#: src/session/download.c:1188 +#: src/session/download.c:1211 msgid "The output of the program will be shown in the tab" msgstr "Wyniki programu bêd± widoczne na karcie" # -#: src/session/download.c:1192 +#: src/session/download.c:1215 msgid "Block the terminal" msgstr "Blokowanie terminala" -#: src/session/download.c:1199 +#: src/session/download.c:1222 #, c-format msgid "The file will be opened with the program '%s'." msgstr "Plik zostanie otwarty przy u¿yciu programu '%s'." #. accelerator_context(src/session/download.c:do_type_query) -#: src/session/download.c:1220 +#: src/session/download.c:1243 msgid "~Open" msgstr "~Otwórz" -#: src/session/session.c:762 src/session/session.c:781 src/session/task.c:270 -#: src/viewer/text/textarea.c:625 +#. Casting size_t fc_maxlength to unsigned int +#. * and formatting it with "%u" is safe, +#. * because fc_maxlength is smaller than +#. * file.length, which is an int. +#: src/session/session.c:757 src/session/session.c:776 src/session/task.c:274 +#: src/viewer/text/textarea.c:648 msgid "Warning" msgstr "Ostrze¿enie" -#: src/session/session.c:763 +#: src/session/session.c:758 msgid "" "You have empty string in protocol.http.user_agent - this was a default value " "in the past, substituted by default ELinks User-Agent string. However, " @@ -8558,7 +8555,7 @@ msgstr "" "co mi chodzi, po prostu to zrób), tak ¿e domy¶lne ustawienie bêdzie u¿ywane. " "Przepraszamy za wszelkie niedogodno¶ci." -#: src/session/session.c:782 +#: src/session/session.c:777 msgid "" "You have option config.saving_style set to a de facto obsolete value. The " "configuration saving algorithms of ELinks were changed from the last time " @@ -8580,11 +8577,11 @@ msgstr "" "saving_style na 3, by uzyskaæ \"w³a¶ciwe\" zachowanie. Przepraszamy za " "wszelkie niedogodno¶ci." -#: src/session/session.c:807 +#: src/session/session.c:802 msgid "Welcome" msgstr "Powitanie" -#: src/session/session.c:808 +#: src/session/session.c:803 msgid "" "Welcome to ELinks!\n" "\n" @@ -8595,7 +8592,7 @@ msgstr "" "Wci¶nij ESC aby wywo³aæ menu. Wybierz Pomoc->Podrêcznik z menu aby zapoznaæ " "siê z instrukcj± u¿ytkowania programu." -#: src/session/task.c:238 +#: src/session/task.c:242 #, c-format msgid "" "The URL you are about to follow might be maliciously crafted in order to " @@ -8609,13 +8606,13 @@ msgstr "" "\n" "Czy przej¶æ do URL-a %s?" -#: src/session/task.c:248 +#: src/session/task.c:252 #, c-format msgid "Do you want to follow the redirect and post form data to URL %s?" msgstr "" "Czy chcesz i¶æ za przekierowaniem i wys³aæ dane formularza do URL-a %s?" -#: src/session/task.c:252 +#: src/session/task.c:256 #, c-format msgid "" "The form data you are about to post might be incomplete.\n" @@ -8624,12 +8621,12 @@ msgstr "" "Dane formularza który chcesz wys³aæ mog± byæ niekompletne.\n" "Czy chcesz wys³aæ formularz pod adres %s?" -#: src/session/task.c:256 +#: src/session/task.c:260 #, c-format msgid "Do you want to post form data to URL %s?" msgstr "Czy chcesz wys³aæ formularz do %s?" -#: src/session/task.c:259 +#: src/session/task.c:263 #, c-format msgid "Do you want to repost form data to URL %s?" msgstr "Czy chcesz ponownie wys³aæ formularz do %s?" @@ -8640,55 +8637,103 @@ msgid "Bad terminal size: %d, %d" msgstr "B³êdny rozmiar terminala: %d, %d" #: src/terminal/event.c:170 +#, c-format msgid "Warning: terminal name contains illicit chars." msgstr "Ostrze¿enie: nazwa terminala zawiera \"nieprzyzwoite\" znaki." -#: src/terminal/event.c:251 +#: src/terminal/event.c:255 +#, c-format msgid "Failed to create session." msgstr "Nie uda³o siê utworzyæ sesji." -#: src/terminal/event.c:439 +#: src/terminal/event.c:442 #, c-format msgid "Bad event %d" msgstr "B³êdne zdarzenie %d" -#: src/terminal/event.c:479 +#: src/terminal/event.c:482 #, c-format msgid "Could not read event: %d (%s)" msgstr "Nie mo¿na odczytaæ zdarzenia: %d (%s)" #: src/terminal/kbd.c:1172 +#, c-format msgid "Too many bytes read from the itrm!" msgstr "Zbyt du¿o bajtów przeczytanych z itrm!" -#: src/terminal/tab.c:204 +# +#. name: +#: src/terminal/screen.c:1129 +msgid "Terminal Screen" +msgstr "Ekran terminala" + +#: src/terminal/tab.c:205 msgid "Do you really want to close the current tab?" msgstr "Czy na pewno chcesz zamkn±æ bie¿±c± kartê?" -#: src/terminal/tab.c:247 +#: src/terminal/tab.c:249 msgid "Do you really want to close all except the current tab?" msgstr "Czy na pewno chcesz zamkn±æ wszystkie karty za wyj±tkiem bie¿±cej?" +# +#. name: +#: src/terminal/terminal.c:383 +msgid "Terminal" +msgstr "Terminal" + +#: src/util/secsave.c:361 +msgid "Cannot read the file" +msgstr "B³±d odczytu z pliku" + +#: src/util/secsave.c:363 +msgid "Cannot get file status" +msgstr "Nie mo¿na otrzymaæ statusu pliku" + +#: src/util/secsave.c:365 +msgid "Cannot access the file" +msgstr "B³±d dostêpu do pliku" + +#: src/util/secsave.c:367 +msgid "Cannot create temp file" +msgstr "B³±d przy tworzeniu pliku tymczasowego" + +#: src/util/secsave.c:369 +msgid "Cannot rename the file" +msgstr "B³±d przy zmianie nazwy pliku" + +#: src/util/secsave.c:371 +msgid "File saving disabled by option" +msgstr "Zapis pliku zablokowany przez opcjê" + +#: src/util/secsave.c:375 +msgid "Cannot write the file" +msgstr "B³±d zapisu do pliku" + +#: src/util/secsave.c:379 +msgid "Secure file saving error" +msgstr "B³±d przy bezpiecznym zapisie pliku" + #: src/viewer/dump/dump.c:87 #, c-format msgid "Can't write to stdout: %s" msgstr "B³±d przy zapisywaniu na standardowe wyj¶cie: %s" #: src/viewer/dump/dump.c:90 +#, c-format msgid "Can't write to stdout." msgstr "Nie mo¿na zapisaæ na standardowe wyj¶cie." -#: src/viewer/dump/dump.c:285 +#: src/viewer/dump/dump.c:286 #, c-format msgid "URL protocol not supported (%s)." msgstr "Protokó³ URL-a nie obs³ugiwany (%s)." # -#: src/viewer/text/draw.c:76 +#: src/viewer/text/draw.c:77 msgid "Missing fragment" msgstr "Brakuj±cy fragment" -#: src/viewer/text/draw.c:77 +#: src/viewer/text/draw.c:78 #, c-format msgid "The requested fragment \"%s\" doesn't exist." msgstr "Wybrany fragment \"%s\" nie istnieje." @@ -8702,273 +8747,279 @@ msgstr "Wyst msgid "Could not load file %s: %s" msgstr "Nie mo¿na wczytaæ pliku %s: %s" -#: src/viewer/text/form.c:1786 +#: src/viewer/text/form.c:1787 msgid "Reset form" msgstr "Wyczy¶æ formularz" # -#: src/viewer/text/form.c:1788 +#: src/viewer/text/form.c:1789 msgid "Harmless button" msgstr "Nieszkodliwy przycisk" -#: src/viewer/text/form.c:1796 +#: src/viewer/text/form.c:1797 msgid "Submit form to" msgstr "Prze¶lij formularz do" -#: src/viewer/text/form.c:1797 +#: src/viewer/text/form.c:1798 msgid "Post form to" msgstr "Wy¶lij formularz do" -#: src/viewer/text/form.c:1799 +#: src/viewer/text/form.c:1800 msgid "Radio button" msgstr "Okr±g³y przycisk" -#: src/viewer/text/form.c:1803 +#: src/viewer/text/form.c:1804 msgid "Select field" msgstr "Pole wyboru" -#: src/viewer/text/form.c:1807 +#: src/viewer/text/form.c:1808 msgid "Text area" msgstr "Pole tekstowe" -#: src/viewer/text/form.c:1809 +#: src/viewer/text/form.c:1810 msgid "File upload" msgstr "£adowanie pliku" -#: src/viewer/text/form.c:1811 +#: src/viewer/text/form.c:1812 msgid "Password field" msgstr "Pole has³a" -#: src/viewer/text/form.c:1849 +#: src/viewer/text/form.c:1850 msgid "name" msgstr "nazwa" -#: src/viewer/text/form.c:1861 +#: src/viewer/text/form.c:1862 msgid "value" msgstr "warto¶æ" -#: src/viewer/text/form.c:1874 +#: src/viewer/text/form.c:1875 msgid "read only" msgstr "tylko do odczytu" -#: src/viewer/text/form.c:1885 +#: src/viewer/text/form.c:1886 #, c-format msgid "press %s to navigate" msgstr "wci¶nij %s aby nawigowaæ" -#: src/viewer/text/form.c:1887 +#: src/viewer/text/form.c:1888 #, c-format msgid "press %s to edit" msgstr "wci¶nij %s aby edytowaæ" -#: src/viewer/text/form.c:1923 +#: src/viewer/text/form.c:1924 #, c-format msgid "press %s to submit to %s" msgstr "wci¶nij %s aby wys³aæ do %s" -#: src/viewer/text/form.c:1925 +#: src/viewer/text/form.c:1926 #, c-format msgid "press %s to post to %s" msgstr "wci¶nij %s aby wys³aæ do %s" # -#: src/viewer/text/form.c:2027 +#: src/viewer/text/form.c:2028 msgid "Useless button" msgstr "Bezu¿yteczny przycisk" -#: src/viewer/text/form.c:2029 +#: src/viewer/text/form.c:2030 msgid "Submit button" msgstr "Przycisk wys³ania formularza" #. accelerator_context(link_menu.map) -#: src/viewer/text/link.c:1273 +#: src/viewer/text/link.c:1278 msgid "Display ~usemap" msgstr "Poka¿ ~mapê obrazków" #. accelerator_context(link_menu.std) -#: src/viewer/text/link.c:1278 +#: src/viewer/text/link.c:1283 msgid "~Follow link" msgstr "Wybierz od~no¶nik" #. accelerator_context(link_menu.std) -#: src/viewer/text/link.c:1280 +#: src/viewer/text/link.c:1285 msgid "Follow link and r~eload" msgstr "Wybierz odno¶nik i p~rze³aduj" #. accelerator_context(link_menu.std) -#: src/viewer/text/link.c:1284 +#: src/viewer/text/link.c:1289 msgid "Open in new ~window" msgstr "Otwórz w no~wym oknie" #. accelerator_context(link_menu.std) -#: src/viewer/text/link.c:1286 +#: src/viewer/text/link.c:1291 msgid "Open in new ~tab" msgstr "Otwórz w nowej ~karcie" #. accelerator_context(link_menu.std) -#: src/viewer/text/link.c:1288 +#: src/viewer/text/link.c:1293 msgid "Open in new tab in ~background" msgstr "Otwórz w nowej k~arcie w tle" #. accelerator_context(link_menu.std) -#: src/viewer/text/link.c:1293 +#: src/viewer/text/link.c:1298 msgid "~Download link" msgstr "~Pobierz" #. accelerator_context(link_menu.std) -#: src/viewer/text/link.c:1296 +#: src/viewer/text/link.c:1301 msgid "~Add link to bookmarks" msgstr "~Dodaj zak³adkê" #. accelerator_context(link_menu.std) -#: src/viewer/text/link.c:1300 +#: src/viewer/text/link.c:1305 msgid "Pass link URI to e~xternal command" msgstr "Przeka¿ URI odno¶nika do z~ewnêtrznego polecenia" #. accelerator_context(link_menu.form, link_menu.reset, link_menu.textarea) -#: src/viewer/text/link.c:1311 src/viewer/text/link.c:1351 +#: src/viewer/text/link.c:1316 src/viewer/text/link.c:1356 msgid "~Reset form" msgstr "Wy~czy¶æ formularz" #. accelerator_context(link_menu.textarea) -#: src/viewer/text/link.c:1326 +#: src/viewer/text/link.c:1331 msgid "Open in ~external editor" msgstr "Otwórz w zewnêtrznym ~edytorze" #. accelerator_context(link_menu.form, link_menu.textarea) -#: src/viewer/text/link.c:1334 +#: src/viewer/text/link.c:1339 msgid "~Submit form" msgstr "~Prze¶lij formularz" #. accelerator_context(link_menu.form, link_menu.textarea) -#: src/viewer/text/link.c:1335 +#: src/viewer/text/link.c:1340 msgid "Submit form and rel~oad" msgstr "Prze¶lij fo~rmularz i prze³aduj" #. accelerator_context(link_menu.form, link_menu.textarea) -#: src/viewer/text/link.c:1339 +#: src/viewer/text/link.c:1344 msgid "Submit form and open in new ~window" msgstr "Prze¶lij ~formularz i otwórz w nowym oknie" #. accelerator_context(link_menu.form, link_menu.textarea) -#: src/viewer/text/link.c:1341 +#: src/viewer/text/link.c:1346 msgid "Submit form and open in new ~tab" msgstr "Prze¶lij formularz i otwórz na nowej ~karcie" #. accelerator_context(link_menu.form, link_menu.textarea) -#: src/viewer/text/link.c:1344 +#: src/viewer/text/link.c:1349 msgid "Submit form and open in new tab in ~background" msgstr "Prze¶lij formularz i otwórz w ~tle na nowej karcie" #. accelerator_context(link_menu.form, link_menu.textarea) -#: src/viewer/text/link.c:1349 +#: src/viewer/text/link.c:1354 msgid "Submit form and ~download" msgstr "Prze¶lij formu~larz i ¶ci±gnij" #. accelerator_context(link_menu.form, link_menu.reset, link_menu.textarea) -#: src/viewer/text/link.c:1356 +#: src/viewer/text/link.c:1361 msgid "Form f~ields" msgstr "Pola form~ularza" #. accelerator_context(link_menu.form, link_menu.map, link_menu.std) -#: src/viewer/text/link.c:1363 +#: src/viewer/text/link.c:1368 msgid "V~iew image" msgstr "Poka¿ o~brazek" #. accelerator_context(link_menu.form, link_menu.map, link_menu.std) -#: src/viewer/text/link.c:1365 +#: src/viewer/text/link.c:1370 msgid "Download ima~ge" msgstr "Pobierz ~obrazek" -#: src/viewer/text/link.c:1374 +#: src/viewer/text/link.c:1379 msgid "No link selected" msgstr "Nie wybrano ¿adnego odno¶nika" -#: src/viewer/text/link.c:1444 +#: src/viewer/text/link.c:1449 msgid "Image" msgstr "Obrazek" -#: src/viewer/text/link.c:1449 +#: src/viewer/text/link.c:1454 msgid "Usemap" msgstr "Mapa obrazków" -#: src/viewer/text/search.c:1078 +#. name: +#: src/viewer/text/marks.c:155 +msgid "Marks" +msgstr "Zaznaczenia" + +#: src/viewer/text/search.c:1081 msgid "Search hit top, continuing at bottom." msgstr "Przeszukiwanie osi±gnê³o pocz±tek tekstu, kontynuacja od koñca." -#: src/viewer/text/search.c:1079 +#: src/viewer/text/search.c:1082 msgid "Search hit bottom, continuing at top." msgstr "Przeszukiwanie osi±gnê³o koniec tekstu, kontynuacja od pocz±tku." -#: src/viewer/text/search.c:1082 +#: src/viewer/text/search.c:1085 msgid "No previous search" msgstr "Niczego wcze¶niej nie szukano" -#: src/viewer/text/search.c:1094 +#: src/viewer/text/search.c:1097 #, c-format msgid "Could not compile regular expression '%s'" msgstr "Nie mogê skompilowaæ wyra¿enia regularnego '%s'" -#: src/viewer/text/search.c:1137 +#: src/viewer/text/search.c:1140 #, c-format msgid "No further matches for '%s'." msgstr "Brak dalszych trafieñ dla '%s'." -#: src/viewer/text/search.c:1139 +#: src/viewer/text/search.c:1142 #, c-format msgid "Could not find a link with the text '%s'." msgstr "Nie mo¿na znale¼æ odno¶nika z tekstem '%s'." -#: src/viewer/text/search.c:1141 src/viewer/text/search.c:1549 +#: src/viewer/text/search.c:1144 src/viewer/text/search.c:1552 msgid "Typeahead" msgstr "Szukanie z wyprzedzeniem" -#: src/viewer/text/search.c:1551 +#: src/viewer/text/search.c:1554 +#, c-format msgid "No links in current document" msgstr "Brak odno¶ników w bie¿±cym dokumencie" -#: src/viewer/text/search.c:1629 +#: src/viewer/text/search.c:1632 msgid "Search for text" msgstr "Znajd¼ tekst" -#: src/viewer/text/search.c:1660 +#: src/viewer/text/search.c:1663 msgid "Normal search" msgstr "Zwyk³e szukanie" -#: src/viewer/text/search.c:1661 +#: src/viewer/text/search.c:1664 msgid "Regexp search" msgstr "Szukanie z u¿yciem wyra¿eñ regularnych" -#: src/viewer/text/search.c:1662 +#: src/viewer/text/search.c:1665 msgid "Extended regexp search" msgstr "Szukanie z u¿yciem rozszerzonych wyra¿eñ regularnych" -#: src/viewer/text/search.c:1663 +#: src/viewer/text/search.c:1666 msgid "Case sensitive" msgstr "Rozró¿nianie wielko¶ci liter" -#: src/viewer/text/search.c:1664 +#: src/viewer/text/search.c:1667 msgid "Case insensitive" msgstr "Nierozró¿nianie wielko¶ci liter" -#: src/viewer/text/search.c:1688 +#: src/viewer/text/search.c:1691 msgid "Search backward" msgstr "Szukaj wstecz" #. name: -#: src/viewer/text/search.c:1727 +#: src/viewer/text/search.c:1730 msgid "Search History" msgstr "Szukanie w historii" -#: src/viewer/text/textarea.c:572 +#: src/viewer/text/textarea.c:591 msgid "You cannot launch an external editor in the anonymous mode." msgstr "Nie mo¿esz uruchomiæ zewnêtrznego edytora w trybie anonimowym." -#: src/viewer/text/textarea.c:579 +#: src/viewer/text/textarea.c:598 msgid "You can do this only on the master terminal" msgstr "Mo¿esz zrobiæ to jedynie na g³ównym terminalu" -#: src/viewer/text/textarea.c:628 +#: src/viewer/text/textarea.c:651 #, c-format msgid "" "You have exceeded the textarea's size limit: your input is %d bytes, but the " @@ -8999,11 +9050,131 @@ msgstr "B msgid "Error writing to file" msgstr "B³±d zapisu do pliku" +#. name: +#: src/viewer/timer.c:88 +msgid "Timer" +msgstr "Czasomierz" + #. name: #: src/viewer/viewer.c:25 msgid "Viewer" msgstr "Przegl±darka" +#~ msgid "Delete text from clipboard" +#~ msgstr "Skasuj tekst w schowku" + +#~ msgid "" +#~ "Color mode for dumps:\n" +#~ "-1 is standard dump mode\n" +#~ "0 is mono mode\n" +#~ "1 is 16 color mode\n" +#~ "2 is 88 color mode\n" +#~ "3 is 256 color mode" +#~ msgstr "" +#~ "Tryb koloru dla zrzutów:\n" +#~ "-1 - tryb standardowy\n" +#~ " 0 - tryb monochromatyczny\n" +#~ " 1 - tryb 16-kolorowy\n" +#~ " 2 - tryb 88-kolorowy\n" +#~ " 3 - tryb 256-kolorowy" + +#~ msgid "" +#~ "Color mode for dumps:\n" +#~ "-1 is standard dump mode\n" +#~ "0 is mono mode\n" +#~ "1 is 16 color mode\n" +#~ "2 is 88 color mode" +#~ msgstr "" +#~ "Tryb koloru dla zrzutów:\n" +#~ "-1 - tryb standardowy\n" +#~ " 0 - tryb monochromatyczny\n" +#~ " 1 - tryb 16-kolorowy\n" +#~ " 2 - tryb 88-kolorowy" + +#~ msgid "" +#~ "Color mode for dumps:\n" +#~ "-1 is standard dump mode\n" +#~ "0 is mono mode\n" +#~ "1 is 16 color mode\n" +#~ "2 is 256 color mode" +#~ msgstr "" +#~ "Tryb koloru dla zrzutów:\n" +#~ "-1 - tryb standardowy\n" +#~ " 0 - tryb monochromatyczny\n" +#~ " 1 - tryb 16-kolorowy\n" +#~ " 2 - tryb 256-kolorowy" + +#~ msgid "" +#~ "Color mode for dumps:\n" +#~ "-1 is standard dump mode\n" +#~ "0 is mono mode\n" +#~ "1 is 16 color mode" +#~ msgstr "" +#~ "Tryb koloru dla zrzutów:\n" +#~ "-1 - tryb standardowy\n" +#~ " 0 - tryb monochromatyczny\n" +#~ " 1 - tryb 16-kolorowy" + +#~ msgid "" +#~ "Color mode for dumps:\n" +#~ "-1 is standard dump mode\n" +#~ "0 is mono mode\n" +#~ "1 is 16 color mode\n" +#~ "2 is 88 color mode\n" +#~ "3 is 256 color mode\n" +#~ "4 is true color mode" +#~ msgstr "" +#~ "Tryb koloru dla zrzutów:\n" +#~ "-1 - tryb standardowy\n" +#~ " 0 - tryb monochromatyczny\n" +#~ " 1 - tryb 16-kolorowy\n" +#~ " 2 - tryb 88-kolorowy\n" +#~ " 3 - tryb 256-kolorowy\n" +#~ " 4 - tryb koloru 24-bitowy" + +#~ msgid "" +#~ "Color mode for dumps:\n" +#~ "-1 is standard dump mode\n" +#~ "0 is mono mode\n" +#~ "1 is 16 color mode\n" +#~ "2 is 88 color mode\n" +#~ "3 is true color mode" +#~ msgstr "" +#~ "Tryb koloru dla zrzutów:\n" +#~ "-1 - tryb standardowy\n" +#~ " 0 - tryb monochromatyczny\n" +#~ " 1 - tryb 16-kolorowy\n" +#~ " 2 - tryb 88-kolorowy\n" +#~ " 3 - tryb koloru 24-bitowy" + +#~ msgid "" +#~ "Color mode for dumps:\n" +#~ "-1 is standard dump mode\n" +#~ "0 is mono mode\n" +#~ "1 is 16 color mode\n" +#~ "2 is 256 color mode\n" +#~ "3 is true color mode" +#~ msgstr "" +#~ "Tryb koloru dla zrzutów:\n" +#~ "-1 - tryb standardowy\n" +#~ " 0 - tryb monochromatyczny\n" +#~ " 1 - tryb 16-kolorowy\n" +#~ " 2 - tryb 88-kolorowy\n" +#~ " 3 - tryb koloru 24-bitowy" + +#~ msgid "" +#~ "Color mode for dumps:\n" +#~ "-1 is standard dump mode\n" +#~ "0 is mono mode\n" +#~ "1 is 16 color mode\n" +#~ "2 is true color mode" +#~ msgstr "" +#~ "Tryb koloru dla zrzutów:\n" +#~ "-1 - tryb standardowy\n" +#~ " 0 - tryb monochromatyczny\n" +#~ " 1 - tryb 16-kolorowy\n" +#~ " 2 - tryb koloru 24-bitowy" + #~ msgid "HTTP Authentication" #~ msgstr "Uwierzytelnienie HTTP" diff --git a/src/Makefile b/src/Makefile index 5ec01324..3b8387cd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -38,6 +38,14 @@ vernum.o: $(LIB_O_NAME) elinks: $(LIB_O_NAME) vernum.o $(call cmd,link) +TAGS: + find $(srcdir). \( -name "*.[ch]" -o -name "*.inc" \) -print \ + | etags --regex='{c}/INIT_LIST_HEAD(\([[:alnum:]_]+\))/\1/' \ + --regex='{c}/struct_hierbox_browser(\n[ \t]*\([[:alnum:]_]+\),/\1/m' \ + --regex='{c}/^ACTION_(\([[:alnum:]_]+\),[^,]*,[ \t]*\([[:alnum:]_]+\),/ACT_\1_\2/' \ + --language=c - +.PHONY: TAGS + PROGS = elinks CLEAN = vernum.o diff --git a/src/bfu/button.c b/src/bfu/button.c index 8b84110a..e175c0e5 100644 --- a/src/bfu/button.c +++ b/src/bfu/button.c @@ -36,7 +36,7 @@ #ifdef DEBUG_BUTTON_HOTKEY void -add_dlg_button_do(unsigned char *file, int line, +add_dlg_button_do(const unsigned char *file, int line, struct dialog *dlg, unsigned char *text, int flags, widget_handler_T *handler, void *data, done_handler_T *done, void *done_data) @@ -331,7 +331,7 @@ select_button(struct dialog_data *dlg_data, struct widget_data *widget_data) return widget_data->widget->handler(dlg_data, widget_data); } -struct widget_ops button_ops = { +const struct widget_ops button_ops = { display_button, NULL, mouse_button, diff --git a/src/bfu/button.h b/src/bfu/button.h index 90dba05f..ca7b3d65 100644 --- a/src/bfu/button.h +++ b/src/bfu/button.h @@ -30,7 +30,7 @@ struct widget_info_button { #ifdef DEBUG_BUTTON_HOTKEY -void add_dlg_button_do(unsigned char *file, int line, struct dialog *dlg, unsigned char *text, int flags, widget_handler_T *handler, void *data, done_handler_T *done, void *done_data); +void add_dlg_button_do(const unsigned char *file, int line, struct dialog *dlg, unsigned char *text, int flags, widget_handler_T *handler, void *data, done_handler_T *done, void *done_data); #define add_dlg_ok_button(dlg, text, flags, done, data) \ add_dlg_button_do(__FILE__, __LINE__, dlg, text, flags, ok_dialog, NULL, done, data) @@ -47,7 +47,7 @@ void add_dlg_button_do(struct dialog *dlg, unsigned char *text, int flags, widge add_dlg_button_do(dlg, text, flags, handler, data, NULL, NULL) #endif -extern struct widget_ops button_ops; +extern const struct widget_ops button_ops; void dlg_format_buttons(struct terminal *, struct widget_data *, int, int, int *, int, int *, enum format_align, int); #endif diff --git a/src/bfu/checkbox.c b/src/bfu/checkbox.c index 8fa6c636..7ed97e0b 100644 --- a/src/bfu/checkbox.c +++ b/src/bfu/checkbox.c @@ -164,7 +164,7 @@ select_checkbox(struct dialog_data *dlg_data, struct widget_data *widget_data) return EVENT_PROCESSED; } -struct widget_ops checkbox_ops = { +const struct widget_ops checkbox_ops = { display_checkbox, init_checkbox, mouse_checkbox, diff --git a/src/bfu/checkbox.h b/src/bfu/checkbox.h index 627be572..573f1d2f 100644 --- a/src/bfu/checkbox.h +++ b/src/bfu/checkbox.h @@ -27,7 +27,7 @@ void add_dlg_radio_do(struct dialog *dlg, unsigned char *text, int groupid, int #define add_dlg_checkbox(dlg, text, data) \ add_dlg_radio_do(dlg, text, 0, 0, data) -extern struct widget_ops checkbox_ops; +extern const struct widget_ops checkbox_ops; void dlg_format_checkbox(struct terminal *term, diff --git a/src/bfu/dialog.c b/src/bfu/dialog.c index 62048ef3..335c4ec6 100644 --- a/src/bfu/dialog.c +++ b/src/bfu/dialog.c @@ -140,7 +140,7 @@ select_dlg_item(struct dialog_data *dlg_data, struct widget_data *widget_data) widget_data->widget->ops->select(dlg_data, widget_data); } -static struct widget_ops *widget_type_to_ops[] = { +static const struct widget_ops *const widget_type_to_ops[] = { &checkbox_ops, &field_ops, &field_pass_ops, @@ -344,7 +344,7 @@ static void dialog_ev_kbd(struct dialog_data *dlg_data) { struct widget_data *widget_data = selected_widget(dlg_data); - struct widget_ops *ops = widget_data->widget->ops; + const struct widget_ops *ops = widget_data->widget->ops; /* XXX: KEYMAP_EDIT ? --pasky */ enum menu_action action_id; struct term_event *ev = dlg_data->term_event; diff --git a/src/bfu/hierbox.c b/src/bfu/hierbox.c index 86f4f3bb..c8e3b65b 100644 --- a/src/bfu/hierbox.c +++ b/src/bfu/hierbox.c @@ -43,7 +43,7 @@ add_listbox_item(struct hierbox_browser *browser, struct listbox_item *root, struct listbox_item *item; if (!root) { - assertm(browser, "Nowhere to add new list box item"); + assertm(browser != NULL, "Nowhere to add new list box item"); root = &browser->root; } @@ -318,7 +318,7 @@ hierbox_browser(struct hierbox_browser *browser, struct session *ses) add_dlg_listbox(dlg, listbox_data); for (button = 0; button < browser->buttons_size; button++) { - struct hierbox_browser_button *but = &browser->buttons[button]; + const struct hierbox_browser_button *but = &browser->buttons[button]; /* Skip buttons that should not be displayed in anonymous mode */ if (anonymous && !but->anonymous) { @@ -335,7 +335,7 @@ hierbox_browser(struct hierbox_browser *browser, struct session *ses) * have to subtract one. */ add_dlg_end(dlg, button + 2 - (anonymous ? anonymous - 1 : 0)); - return do_dialog(term, dlg, getml(dlg, NULL)); + return do_dialog(term, dlg, getml(dlg, (void *) NULL)); } @@ -434,11 +434,11 @@ push_hierbox_info_button(struct dialog_data *dlg_data, struct widget_data *butto box->ops->lock(item); - msg_box(term, getml(context, NULL), MSGBOX_FREE_TEXT /* | MSGBOX_SCROLLABLE */, + msg_box(term, getml(context, (void *) NULL), MSGBOX_FREE_TEXT /* | MSGBOX_SCROLLABLE */, N_("Info"), ALIGN_LEFT, msg, context, 1, - N_("~OK"), done_listbox_context, B_ESC | B_ENTER); + MSG_BOX_BUTTON(N_("~OK"), done_listbox_context, B_ESC | B_ENTER)); return EVENT_PROCESSED; } @@ -547,7 +547,7 @@ enum delete_error { DELETE_ERRORS, }; -struct listbox_ops_messages default_listbox_ops_messages = { +static const struct listbox_ops_messages default_listbox_ops_messages = { /* cant_delete_item */ N_("Sorry, but the item \"%s\" cannot be deleted."), @@ -592,7 +592,7 @@ struct listbox_ops_messages default_listbox_ops_messages = { static void print_delete_error(struct listbox_item *item, struct terminal *term, - struct listbox_ops *ops, enum delete_error err) + const struct listbox_ops *ops, enum delete_error err) { struct string msg; unsigned char *errmsg; @@ -647,7 +647,7 @@ static void do_delete_item(struct listbox_item *item, struct listbox_context *info, int last) { - struct listbox_ops *ops = info->box->ops; + const struct listbox_ops *ops = info->box->ops; assert(item); @@ -720,7 +720,7 @@ query_delete_selected_item(void *context_) struct listbox_context *context, *oldcontext = context_; struct terminal *term = oldcontext->term; struct listbox_data *box = oldcontext->box; - struct listbox_ops *ops = box->ops; + const struct listbox_ops *ops = box->ops; struct listbox_item *item = box->sel; unsigned char *text; enum delete_error delete; @@ -747,24 +747,24 @@ query_delete_selected_item(void *context_) if (item->type == BI_FOLDER) { ops->lock(item); - msg_box(term, getml(context, NULL), MSGBOX_FREE_TEXT, + msg_box(term, getml(context, (void *) NULL), MSGBOX_FREE_TEXT, listbox_message(delete_folder_title), ALIGN_CENTER, msg_text(term, listbox_message(delete_folder), text), context, 2, - N_("~Yes"), push_ok_delete_button, B_ENTER, - N_("~No"), done_listbox_context, B_ESC); + MSG_BOX_BUTTON(N_("~Yes"), push_ok_delete_button, B_ENTER), + MSG_BOX_BUTTON(N_("~No"), done_listbox_context, B_ESC)); } else { unsigned char *msg = ops->get_info(item, term); ops->lock(item); - msg_box(term, getml(context, NULL), MSGBOX_FREE_TEXT, + msg_box(term, getml(context, (void *) NULL), MSGBOX_FREE_TEXT, listbox_message(delete_item_title), ALIGN_LEFT, msg_text(term, listbox_message(delete_item), text, empty_string_or_(msg)), context, 2, - N_("~Yes"), push_ok_delete_button, B_ENTER, - N_("~No"), done_listbox_context, B_ESC); + MSG_BOX_BUTTON(N_("~Yes"), push_ok_delete_button, B_ENTER), + MSG_BOX_BUTTON(N_("~No"), done_listbox_context, B_ESC)); mem_free_if(msg); } mem_free(text); @@ -772,6 +772,12 @@ query_delete_selected_item(void *context_) return EVENT_PROCESSED; } +static void +dont_delete_marked_items(void *const context_) +{ + query_delete_selected_item(context_); +} + widget_handler_status_T push_hierbox_delete_button(struct dialog_data *dlg_data, struct widget_data *button) @@ -779,7 +785,7 @@ push_hierbox_delete_button(struct dialog_data *dlg_data, /* [gettext_accelerator_context(push_hierbox_delete_button)] */ struct terminal *term = dlg_data->win->term; struct listbox_data *box = get_dlg_listbox_data(dlg_data); - struct listbox_ops *ops = box->ops; + const struct listbox_ops *ops = box->ops; struct listbox_item *item = box->sel; struct listbox_context *context; @@ -801,12 +807,12 @@ push_hierbox_delete_button(struct dialog_data *dlg_data, return status; } - msg_box(term, getml(context, NULL), 0, + msg_box(term, getml(context, (void *) NULL), 0, listbox_message(delete_marked_items_title), ALIGN_CENTER, listbox_message(delete_marked_items), context, 2, - N_("~Yes"), push_ok_delete_button, B_ENTER, - N_("~No"), query_delete_selected_item, B_ESC); + MSG_BOX_BUTTON(N_("~Yes"), push_ok_delete_button, B_ENTER), + MSG_BOX_BUTTON(N_("~No"), dont_delete_marked_items, B_ESC)); return EVENT_PROCESSED; } @@ -842,7 +848,7 @@ push_hierbox_clear_button(struct dialog_data *dlg_data, { /* [gettext_accelerator_context(push_hierbox_clear_button)] */ struct listbox_data *box = get_dlg_listbox_data(dlg_data); - struct listbox_ops *ops = box->ops; + const struct listbox_ops *ops = box->ops; struct terminal *term = dlg_data->win->term; struct listbox_context *context; @@ -863,12 +869,12 @@ push_hierbox_clear_button(struct dialog_data *dlg_data, return EVENT_PROCESSED; } - msg_box(term, getml(context, NULL), 0, + msg_box(term, getml(context, (void *) NULL), 0, listbox_message(clear_all_items_title), ALIGN_CENTER, listbox_message(clear_all_items), context, 2, - N_("~Yes"), do_clear_browser, B_ENTER, - N_("~No"), NULL, B_ESC); + MSG_BOX_BUTTON(N_("~Yes"), do_clear_browser, B_ENTER), + MSG_BOX_BUTTON(N_("~No"), NULL, B_ESC)); return EVENT_PROCESSED; } diff --git a/src/bfu/hierbox.h b/src/bfu/hierbox.h index b98300de..513d0974 100644 --- a/src/bfu/hierbox.h +++ b/src/bfu/hierbox.h @@ -18,13 +18,13 @@ struct hierbox_browser_button { struct hierbox_browser { unsigned char *title; void (*expansion_callback)(void); - struct hierbox_browser_button *buttons; + const struct hierbox_browser_button *buttons; size_t buttons_size; struct list_head boxes; struct list_head dialogs; struct listbox_item root; - struct listbox_ops *ops; + const struct listbox_ops *ops; /* For saving state */ unsigned int do_not_save_state:1; diff --git a/src/bfu/inpfield.c b/src/bfu/inpfield.c index 7edd838c..ed6c8590 100644 --- a/src/bfu/inpfield.c +++ b/src/bfu/inpfield.c @@ -238,7 +238,7 @@ input_field(struct terminal *term, struct memory_list *ml, int intl, add_dlg_end(dlg, INPUT_WIDGETS_COUNT); - add_to_ml(&ml, dlg, NULL); + add_to_ml(&ml, (void *) dlg, (void *) NULL); do_dialog(term, dlg, ml); } @@ -744,7 +744,7 @@ clear_field(struct dialog_data *dlg_data, struct widget_data *widget_data) return EVENT_PROCESSED; } -struct widget_ops field_ops = { +const struct widget_ops field_ops = { display_field, init_field, mouse_field, @@ -753,7 +753,7 @@ struct widget_ops field_ops = { clear_field, }; -struct widget_ops field_pass_ops = { +const struct widget_ops field_pass_ops = { display_field_pass, init_field, mouse_field, @@ -908,5 +908,5 @@ input_field_line(struct session *ses, unsigned char *prompt, void *data, add_dlg_field_float2(dlg, prompt, 0, 0, NULL, INPUT_LINE_BUFFER_SIZE, buffer, history); - do_dialog(ses->tab->term, dlg, getml(dlg, NULL)); + do_dialog(ses->tab->term, dlg, getml(dlg, (void *) NULL)); } diff --git a/src/bfu/inpfield.h b/src/bfu/inpfield.h index 5bd47da4..2829eb70 100644 --- a/src/bfu/inpfield.h +++ b/src/bfu/inpfield.h @@ -56,8 +56,8 @@ add_dlg_field_do(struct dialog *dlg, enum widget_type type, unsigned char *label add_dlg_field_do(dlg, WIDGET_FIELD_PASS, label, min, max, handler, len, field, NULL, INPFIELD_FLOAT) -extern struct widget_ops field_ops; -extern struct widget_ops field_pass_ops; +extern const struct widget_ops field_ops; +extern const struct widget_ops field_pass_ops; widget_handler_status_T check_number(struct dialog_data *, struct widget_data *); widget_handler_status_T check_nonempty(struct dialog_data *, struct widget_data *); diff --git a/src/bfu/inphist.c b/src/bfu/inphist.c index 11d8db66..b3b714ab 100644 --- a/src/bfu/inphist.c +++ b/src/bfu/inphist.c @@ -289,7 +289,8 @@ load_input_history(struct input_history *history, unsigned char *filename) if (get_cmd_opt_bool("anonymous")) return 0; if (elinks_home) { - history_file = straconcat(elinks_home, filename, NULL); + history_file = straconcat(elinks_home, filename, + (unsigned char *) NULL); if (!history_file) return 0; } @@ -327,7 +328,8 @@ save_input_history(struct input_history *history, unsigned char *filename) || get_cmd_opt_bool("anonymous")) return 0; - history_file = straconcat(elinks_home, filename, NULL); + history_file = straconcat(elinks_home, filename, + (unsigned char *) NULL); if (!history_file) return -1; ssi = secure_open(history_file); diff --git a/src/bfu/listbox.c b/src/bfu/listbox.c index f59fbef8..0ad32a98 100644 --- a/src/bfu/listbox.c +++ b/src/bfu/listbox.c @@ -452,7 +452,7 @@ display_listbox_item(struct listbox_item *item, void *data_, int *offset) } else { unsigned char *text; - struct listbox_ops *ops = data->box->ops; + const struct listbox_ops *ops = data->box->ops; int len_bytes; assert(ops && ops->get_info); @@ -735,7 +735,7 @@ kbd_listbox(struct dialog_data *dlg_data, struct widget_data *widget_data) return EVENT_NOT_PROCESSED; } -struct widget_ops listbox_ops = { +const struct widget_ops listbox_ops = { display_listbox, init_listbox, mouse_listbox, diff --git a/src/bfu/listbox.h b/src/bfu/listbox.h index 9aadbd95..bca2a266 100644 --- a/src/bfu/listbox.h +++ b/src/bfu/listbox.h @@ -100,7 +100,7 @@ struct listbox_ops { struct listbox_data { LIST_HEAD(struct listbox_data); - struct listbox_ops *ops; /* Backend-provided operations */ + const struct listbox_ops *ops; /* Backend-provided operations */ struct listbox_item *sel; /* Item currently selected */ struct listbox_item *top; /* Item which is on the top line of the box */ @@ -131,7 +131,7 @@ struct listbox_item { void *udata; }; -extern struct widget_ops listbox_ops; +extern const struct widget_ops listbox_ops; void dlg_format_listbox(struct terminal *, struct widget_data *, int, int *, int, int, int *, enum format_align, int format_only); diff --git a/src/bfu/listmenu.c b/src/bfu/listmenu.c index 9a95990d..ecf95677 100644 --- a/src/bfu/listmenu.c +++ b/src/bfu/listmenu.c @@ -177,7 +177,7 @@ menu_labels(struct menu_item *items, unsigned char *base, unsigned char **lbls) foreach_menu_item (item, items) { bs = (item->flags & MENU_FULLNAME) ? (unsigned char *) "" : base; - bs = straconcat(bs, item->text, NULL); + bs = straconcat(bs, item->text, (unsigned char *) NULL); if (!bs) continue; if (item->func == do_select_submenu) { diff --git a/src/bfu/menu.c b/src/bfu/menu.c index 2bee057a..4511a569 100644 --- a/src/bfu/menu.c +++ b/src/bfu/menu.c @@ -171,7 +171,7 @@ select_menu_item(struct terminal *term, struct menu_item *it, void *data) return; } - assertm(func, "No menu function"); + assertm(func != NULL, "No menu function"); if_assert_failed return; func(term, it_data, data); @@ -983,8 +983,8 @@ menu_handler(struct window *win, struct term_event *ev) switch (ev->ev) { case EVENT_INIT: case EVENT_RESIZE: - case EVENT_REDRAW: get_parent_ptr(win, &menu->parent_x, &menu->parent_y); + case EVENT_REDRAW: count_menu_size(win->term, menu); /* do_menu sets menu->selected = 0. If that * item isn't actually selectable, correct diff --git a/src/bfu/msgbox.c b/src/bfu/msgbox.c index 00924cbd..d7af62be 100644 --- a/src/bfu/msgbox.c +++ b/src/bfu/msgbox.c @@ -71,7 +71,7 @@ msg_box(struct terminal *term, struct memory_list *ml, enum msgbox_flags flags, int bflags; label = va_arg(ap, unsigned char *); - done = va_arg(ap, void *); + done = va_arg(ap, done_handler_T *); bflags = va_arg(ap, int); if (!label) { @@ -170,7 +170,7 @@ refreshed_msg_box(struct terminal *term, enum msgbox_flags flags, title, align, info, data, 1, - N_("~OK"), NULL, B_ENTER | B_ESC); + MSG_BOX_BUTTON(N_("~OK"), NULL, B_ENTER | B_ESC)); if (!dlg_data) return; @@ -187,6 +187,9 @@ info_box(struct terminal *term, enum msgbox_flags flags, unsigned char *text) { /* [gettext_accelerator_context(info_box)] */ - return msg_box(term, NULL, flags, title, align, text, - NULL, 1, N_("~OK"), NULL, B_ENTER | B_ESC); + return msg_box(term, NULL, flags, + title, align, + text, + NULL, 1, + MSG_BOX_BUTTON(N_("~OK"), NULL, B_ENTER | B_ESC)); } diff --git a/src/bfu/msgbox.h b/src/bfu/msgbox.h index 3ed0848b..2e06fe8a 100644 --- a/src/bfu/msgbox.h +++ b/src/bfu/msgbox.h @@ -64,7 +64,7 @@ enum msgbox_flags { * @udata Is a reference to any data that should be passed to * the handlers associated with each button. NULL if none. * - * @buttons Denotes the number of buttons given as varadic arguments. + * @buttons Denotes the number of buttons given as variadic arguments. * For each button 3 arguments are extracted: * o First the label text. It is automatically localized * unless MSGBOX_NO_INTL is passed. If NULL, this button @@ -72,6 +72,10 @@ enum msgbox_flags { * o Second pointer to the handler function (taking * one (void *), which is incidentally the udata). * o Third any flags. + * Each triple should be wrapped in the MSG_BOX_BUTTON + * macro, which converts the values to the correct types. + * (The compiler can't do that on its own for variadic + * arguments.) * * Note that you should ALWAYS format the msg_box() call like: * @@ -79,9 +83,9 @@ enum msgbox_flags { * title, align, * text, * udata, M, - * label1, handler1, flags1, + * MSG_BOX_BUTTON(label1, handler1, flags1), * ..., - * labelM, handlerM, flagsM); + * MSG_BOX_BUTTON(labelM, handlerM, flagsM)); * * ...no matter that it could fit on one line in case of a tiny message box. */ struct dialog_data * @@ -89,6 +93,21 @@ msg_box(struct terminal *term, struct memory_list *mem_list, enum msgbox_flags flags, unsigned char *title, enum format_align align, unsigned char *text, void *udata, int buttons, ...); +/* Cast @value to @type and warn if the conversion is suspicious. + * If @value has side effects, this does them only once. + * The expression used here is intended to be standard C, but it is + * somewhat tricky. If it causes trouble on some compiler, you can + * #ifdef an alternative definition that skips the type check. */ +#define MSG_BOX_CAST(type, value) \ + (((void) sizeof(((int (*)(type)) 0)(value))), (type) (value)) + +/* A button in the variadic arguments of msg_box(). + * This macro expands into three arguments. */ +#define MSG_BOX_BUTTON(label, handler, flags) \ + MSG_BOX_CAST(const unsigned char *, label), \ + MSG_BOX_CAST(done_handler_T *, handler), \ + MSG_BOX_CAST(int, flags) + /* msg_text() is basically an equivalent to asprintf(), specifically to be used * inside of message boxes. Please always use msg_text() instead of asprintf() diff --git a/src/bfu/style.c b/src/bfu/style.c index 8e8b5bda..cb7bdcff 100644 --- a/src/bfu/style.c +++ b/src/bfu/style.c @@ -68,7 +68,8 @@ get_bfu_color(struct terminal *term, unsigned char *stylename) struct option *opt; /* Construct the color entry. */ - opt = get_opt_rec_real(config_options, color_mode + opt = get_opt_rec_real(config_options, + color_mode != COLOR_MODE_MONO ? "ui.colors.color" : "ui.colors.mono"); if (!opt) return NULL; diff --git a/src/bfu/text.c b/src/bfu/text.c index 2fa4c1d2..f5e3f1b7 100644 --- a/src/bfu/text.c +++ b/src/bfu/text.c @@ -119,7 +119,6 @@ split_line(unsigned char *text, int max_width, int *cells) * followed by a space so this rule * will not match often. We match dash * and quotes too. */ - cells_save--; while (--split != text) { cells_save--; if (!ispunct(*split)) continue; @@ -542,7 +541,7 @@ mouse_text(struct dialog_data *dlg_data, struct widget_data *widget_data) } -struct widget_ops text_ops = { +const struct widget_ops text_ops = { display_text, NULL, mouse_text, diff --git a/src/bfu/text.h b/src/bfu/text.h index 408c7ce3..8dd33652 100644 --- a/src/bfu/text.h +++ b/src/bfu/text.h @@ -44,7 +44,7 @@ struct widget_data_info_text { void add_dlg_text(struct dialog *dlg, unsigned char *text, enum format_align align, int bottom_pad); -extern struct widget_ops text_ops; +extern const struct widget_ops text_ops; void dlg_format_text_do(struct terminal *term, unsigned char *text, int x, int *y, int w, int *rw, struct color_pair *scolor, enum format_align align, int format_only); diff --git a/src/bfu/widget.h b/src/bfu/widget.h index d54695cb..5e7d1814 100644 --- a/src/bfu/widget.h +++ b/src/bfu/widget.h @@ -30,7 +30,7 @@ struct widget_ops { }; struct widget { - struct widget_ops *ops; + const struct widget_ops *ops; unsigned char *text; @@ -51,11 +51,18 @@ struct widget { struct widget_data { struct widget *widget; + /* For WIDGET_FIELD: If CONFIG_UTF8 is defined and UTF-8 I/O * is enabled for the terminal, then @cdata is in UTF-8; * otherwise, @cdata is in the charset of the terminal, and * the charset is assumed to be unibyte. (Thus, if you choose - * UTF-8 as the charset but disable UTF-8 I/O, you lose.) */ + * UTF-8 as the charset but disable UTF-8 I/O, you lose.) + * + * For WIDGET_TEXT: @cdata is cast from/to an unsigned char ** + * that points to the first element of an array. Each element + * in this array corresponds to one line of text, and is an + * unsigned char * that points to the first character of that + * line. The array has @widget_data.info.text.lines elements. */ unsigned char *cdata; struct box box; diff --git a/src/bookmarks/backend/common.c b/src/bookmarks/backend/common.c index 6fde110c..0890bbd4 100644 --- a/src/bookmarks/backend/common.c +++ b/src/bookmarks/backend/common.c @@ -57,7 +57,8 @@ bookmarks_read(void) file_name = backend->filename(0); if (!file_name) return; if (elinks_home) { - file_name = straconcat(elinks_home, file_name, NULL); + file_name = straconcat(elinks_home, file_name, + (unsigned char *) NULL); if (!file_name) return; } @@ -91,7 +92,7 @@ bookmarks_write(struct list_head *bookmarks_list) * they would be just truncated to zero by secure_open()). */ file_name = backend->filename(1); if (!file_name) return; - file_name = straconcat(elinks_home, file_name, NULL); + file_name = straconcat(elinks_home, file_name, (unsigned char *) NULL); if (!file_name) return; ssi = secure_open(file_name); diff --git a/src/bookmarks/backend/xbel.c b/src/bookmarks/backend/xbel.c index 25ef2cbd..a7639290 100644 --- a/src/bookmarks/backend/xbel.c +++ b/src/bookmarks/backend/xbel.c @@ -183,9 +183,9 @@ print_xml_entities(struct secure_save_info *ssi, const unsigned char *str) || (x) == '{' || (x) == '%' \ || (x) == '+') - static int cp = 0; + static int cp = -1; - if (!cp) get_cp_index("us-ascii"); + if (cp == -1) cp = get_cp_index("us-ascii"); for (; *str; str++) { if (accept_char(*str)) @@ -195,7 +195,7 @@ print_xml_entities(struct secure_save_info *ssi, const unsigned char *str) secure_fprintf(ssi, "&#%i;", (int) *str); } else { - unsigned char *s = u2cp_no_nbsp(*str, cp); + const unsigned char *s = u2cp_no_nbsp(*str, cp); if (s) print_xml_entities(ssi, s); } diff --git a/src/bookmarks/bookmarks.c b/src/bookmarks/bookmarks.c index e1722094..f9e9a45e 100644 --- a/src/bookmarks/bookmarks.c +++ b/src/bookmarks/bookmarks.c @@ -135,7 +135,7 @@ change_hook_folder_state(struct session *ses, struct option *current, static void init_bookmarks(struct module *module) { - struct change_hook_info bookmarks_change_hooks[] = { + static const struct change_hook_info bookmarks_change_hooks[] = { { "bookmarks.folder_state", change_hook_folder_state }, { NULL, NULL }, }; diff --git a/src/bookmarks/dialogs.c b/src/bookmarks/dialogs.c index ed17ecc7..1b020dca 100644 --- a/src/bookmarks/dialogs.c +++ b/src/bookmarks/dialogs.c @@ -139,7 +139,7 @@ static struct listbox_ops_messages bookmarks_messages = { N_("Do you really want to remove all bookmarks?"), }; -static struct listbox_ops bookmarks_listbox_ops = { +static const struct listbox_ops bookmarks_listbox_ops = { lock_bookmark, unlock_bookmark, is_bookmark_used, @@ -341,7 +341,7 @@ enum move_bookmark_flags { }; /* Traverse all bookmarks and move all marked items - * _into_ destb or, if destb is NULL, _after_ dest. */ + * _into_ dest or, if insert_as_child is 0, _after_ dest. */ static enum move_bookmark_flags do_move_bookmark(struct bookmark *dest, int insert_as_child, struct list_head *src, struct listbox_data *box) @@ -482,7 +482,7 @@ push_move_button(struct dialog_data *dlg_data, /**** MANAGEMENT *****************************************************/ -static struct hierbox_browser_button bookmark_buttons[] = { +static const struct hierbox_browser_button bookmark_buttons[] = { /* [gettext_accelerator_context(.bookmark_buttons)] */ { N_("~Goto"), push_hierbox_goto_button, 1 }, { N_("~Edit"), push_edit_button, 0 }, @@ -498,7 +498,7 @@ static struct hierbox_browser_button bookmark_buttons[] = { { N_("Clear"), push_hierbox_clear_button, 0 }, /* TODO: Would this be useful? --jonas */ - { N_("Save"), push_save_button }, + { N_("Save"), push_save_button, 0 }, #endif }; @@ -602,7 +602,7 @@ bookmark_search_do(void *data) struct listbox_data *box; struct dialog_data *dlg_data; - assertm(dlg->udata, "Bookmark search with NULL udata in dialog"); + assertm(dlg->udata != NULL, "Bookmark search with NULL udata in dialog"); if_assert_failed return; ctx.title = dlg->widgets[0].data; diff --git a/src/cache/dialogs.c b/src/cache/dialogs.c index 5a2dc985..b0a33b34 100644 --- a/src/cache/dialogs.c +++ b/src/cache/dialogs.c @@ -209,7 +209,7 @@ static struct listbox_ops_messages cache_messages = { NULL, }; -static struct listbox_ops cache_entry_listbox_ops = { +static const struct listbox_ops cache_entry_listbox_ops = { lock_cache_entry, unlock_cache_entry, is_cache_entry_used, @@ -224,7 +224,7 @@ static struct listbox_ops cache_entry_listbox_ops = { &cache_messages, }; -static struct hierbox_browser_button cache_buttons[] = { +static const struct hierbox_browser_button cache_buttons[] = { /* [gettext_accelerator_context(.cache_buttons)] */ { N_("~Info"), push_hierbox_info_button, 1 }, { N_("~Goto"), push_hierbox_goto_button, 1 }, diff --git a/src/config/actions-edit.inc b/src/config/actions-edit.inc index 058674be..a6ded859 100644 --- a/src/config/actions-edit.inc +++ b/src/config/actions-edit.inc @@ -11,7 +11,7 @@ ACTION_(EDIT, "backspace", BACKSPACE, N__("Delete character in front of the curs ACTION_(EDIT, "beginning-of-buffer", BEGINNING_OF_BUFFER, N__("Go to the first line of the buffer"), 0), ACTION_(EDIT, "cancel", CANCEL, N__("Cancel current state"), 0), ACTION_(EDIT, "copy-clipboard", COPY_CLIPBOARD, N__("Copy text to clipboard"), 0), -ACTION_(EDIT, "cut-clipboard", CUT_CLIPBOARD, N__("Delete text from clipboard"), 0), +ACTION_(EDIT, "cut-clipboard", CUT_CLIPBOARD, N__("Cut text to clipboard"), 0), ACTION_(EDIT, "delete", DELETE, N__("Delete character under cursor"), 0), ACTION_(EDIT, "down", DOWN, N__("Move cursor downwards"), 0), ACTION_(EDIT, "end", END, N__("Go to the end of the page/line"), 0), diff --git a/src/config/conf.c b/src/config/conf.c index 7feea1c8..3376e69d 100644 --- a/src/config/conf.c +++ b/src/config/conf.c @@ -500,13 +500,15 @@ load_config_file(unsigned char *prefix, unsigned char *name, { unsigned char *config_str, *config_file; - config_file = straconcat(prefix, STRING_DIR_SEP, name, NULL); + config_file = straconcat(prefix, STRING_DIR_SEP, name, + (unsigned char *) NULL); if (!config_file) return 1; config_str = read_config_file(config_file); if (!config_str) { mem_free(config_file); - config_file = straconcat(prefix, STRING_DIR_SEP, ".", name, NULL); + config_file = straconcat(prefix, STRING_DIR_SEP, ".", name, + (unsigned char *) NULL); if (!config_file) return 2; config_str = read_config_file(config_file); @@ -765,7 +767,7 @@ create_config_string(unsigned char *prefix, unsigned char *name, smart_config_string(&tmpstring, 2, i18n, options->value.tree, NULL, 0, smart_config_output_fn); if (tmpstring.length > origlen) - add_bytes_to_string(&config, tmpstring.source, tmpstring.length); + add_string_to_string(&config, &tmpstring); done_string(&tmpstring); if (!init_string(&tmpstring)) goto get_me_out; @@ -776,7 +778,7 @@ create_config_string(unsigned char *prefix, unsigned char *name, origlen = tmpstring.length; bind_config_string(&tmpstring); if (tmpstring.length > origlen) - add_bytes_to_string(&config, tmpstring.source, tmpstring.length); + add_string_to_string(&config, &tmpstring); done_string(&tmpstring); get_me_out: @@ -802,7 +804,7 @@ write_config_file(unsigned char *prefix, unsigned char *name, if (name_has_slash && prefix_has_slash) name++; - config_file = straconcat(prefix, slash, name, NULL); + config_file = straconcat(prefix, slash, name, (unsigned char *) NULL); if (!config_file) goto free_cfg_str; ssi = secure_open(config_file); diff --git a/src/config/dialogs.c b/src/config/dialogs.c index e06e4a54..0203c874 100644 --- a/src/config/dialogs.c +++ b/src/config/dialogs.c @@ -32,11 +32,10 @@ static void -toggle_success_msgbox(void *dummy) +disable_success_msgbox(void *dummy) { - /* TODO: option_changed() */ - get_opt_bool("ui.success_msgbox") = !get_opt_bool("ui.success_msgbox"); - get_opt_rec(config_options, "ui.success_msgbox")->flags |= OPT_TOUCHED; + get_opt_bool("ui.success_msgbox") = 0; + option_changed(NULL, get_opt_rec(config_options, "ui.success_msgbox")); } void @@ -55,15 +54,16 @@ write_config_dialog(struct terminal *term, unsigned char *config_file, msg_text(term, N_("Options were saved successfully to config file %s."), config_file), NULL, 2, - N_("~OK"), NULL, B_ENTER | B_ESC, - N_("~Do not show anymore"), toggle_success_msgbox, 0); + MSG_BOX_BUTTON(N_("~OK"), NULL, B_ENTER | B_ESC), + MSG_BOX_BUTTON(N_("~Do not show anymore"), disable_success_msgbox, 0)); return; } strerr = secsave_strerror(secsave_error, term); if (stdio_error > 0) - errmsg = straconcat(strerr, " (", strerror(stdio_error), ")", NULL); + errmsg = straconcat(strerr, " (", strerror(stdio_error), ")", + (unsigned char *) NULL); info_box(term, MSGBOX_FREE_TEXT, N_("Write config error"), ALIGN_CENTER, @@ -122,7 +122,8 @@ get_option_text(struct listbox_item *item, struct terminal *term) if (option->flags & OPT_TOUCHED) return straconcat(_(desc, term), - " (", _("modified", term), ")", NULL); + " (", _("modified", term), ")", + (unsigned char *) NULL); return stracpy(_(desc, term)); } @@ -141,7 +142,8 @@ get_option_info(struct listbox_item *item, struct terminal *term) type = _(option_types[option->type].name, term); if (option->type == OPT_TREE) { type = straconcat(type, " ", - _("(expand by pressing space)", term), NULL); + _("(expand by pressing space)", term), + (unsigned char *) NULL); } add_format_to_string(&info, "\n%s: %s", _("Type", term), type); @@ -243,7 +245,7 @@ delete_option_item(struct listbox_item *item, int last) mark_option_as_deleted(option); } -static struct listbox_ops options_listbox_ops = { +static const struct listbox_ops options_listbox_ops = { lock_option, unlock_option, is_option_used, @@ -275,9 +277,7 @@ check_valid_option(struct dialog_data *dlg_data, struct widget_data *widget_data if (chinon) { if (option_types[option->type].set && option_types[option->type].set(option, chinon)) { - struct option *current = option; - - option_changed(ses, current, option); + option_changed(ses, option); commandline = 0; mem_free(chinon); @@ -328,17 +328,19 @@ build_edit_dialog(struct terminal *term, struct session *ses, name = straconcat(_("Name", term), ": ", option->name, "\n", _("Type", term), ": ", - _(option_types[option->type].name, term), NULL); + _(option_types[option->type].name, term), + (unsigned char *) NULL); desc = straconcat(_("Description", term), ": \n", _(option->desc ? option->desc : (unsigned char *) "N/A", term), - NULL); + (unsigned char *) NULL); range = get_range_string(option); if (range) { if (*range) { unsigned char *tmp; - tmp = straconcat(name, " ", range, NULL); + tmp = straconcat(name, " ", range, + (unsigned char *) NULL); if (tmp) { mem_free(name); name = tmp; @@ -365,7 +367,7 @@ build_edit_dialog(struct terminal *term, struct session *ses, add_dlg_end(dlg, EDIT_WIDGETS_COUNT); - do_dialog(term, dlg, getml(dlg, name, desc, NULL)); + do_dialog(term, dlg, getml(dlg, (void *) name, (void *) desc, (void *) NULL)); #undef EDIT_WIDGETS_COUNT } @@ -474,7 +476,7 @@ invalid_option: ctx->option = option; ctx->widget_data = dlg_data->widgets_data; - input_dialog(term, getml(ctx, NULL), N_("Add option"), N_("Name"), + input_dialog(term, getml(ctx, (void *) NULL), N_("Add option"), N_("Name"), ctx, NULL, MAX_STR_LEN, "", 0, 0, check_option_name, add_option_to_tree, NULL); @@ -495,7 +497,7 @@ push_save_button(struct dialog_data *dlg_data, } -static struct hierbox_browser_button option_buttons[] = { +static const struct hierbox_browser_button option_buttons[] = { /* [gettext_accelerator_context(.option_buttons)] */ { N_("~Info"), push_hierbox_info_button, 1 }, { N_("~Edit"), push_edit_button, 0 }, @@ -730,7 +732,7 @@ delete_keybinding_item(struct listbox_item *item, int last) free_keybinding(keybinding); } -static struct listbox_ops keybinding_listbox_ops = { +static const struct listbox_ops keybinding_listbox_ops = { lock_keybinding, unlock_keybinding, is_keybinding_used, @@ -810,7 +812,7 @@ really_add_keybinding(void *data, unsigned char *keystroke) if (init_string(&canonical)) add_keystroke_to_string(&canonical, &hop->kbd, 0); - msg_box(new_hop->term, getml(new_hop, NULL), MSGBOX_FREE_TEXT, + msg_box(new_hop->term, getml(new_hop, (void *) NULL), MSGBOX_FREE_TEXT, N_("Keystroke already used"), ALIGN_CENTER, msg_text(new_hop->term, N_("The keystroke \"%s\" " "is currently used for \"%s\".\n" @@ -818,8 +820,8 @@ really_add_keybinding(void *data, unsigned char *keystroke) canonical.length ? canonical.source : keystroke, get_action_name(hop->keymap_id, action_id)), new_hop, 2, - N_("~Yes"), really_really_add_keybinding, B_ENTER, - N_("~No"), NULL, B_ESC); + MSG_BOX_BUTTON(N_("~Yes"), really_really_add_keybinding, B_ENTER), + MSG_BOX_BUTTON(N_("~No"), NULL, B_ESC)); done_string(&canonical); /* safe even if init failed */ return; @@ -889,7 +891,7 @@ push_kbdbind_add_button(struct dialog_data *dlg_data, get_action_name(hop->keymap_id, hop->action_id), get_keymap_name(hop->keymap_id)); - input_dialog(term, getml(hop, text, NULL), + input_dialog(term, getml(hop, (void *) text, (void *) NULL), N_("Add keybinding"), text, hop, NULL, MAX_STR_LEN, "", 0, 0, check_keystroke, @@ -924,7 +926,7 @@ push_kbdbind_save_button(struct dialog_data *dlg_data, static INIT_LIST_HEAD(keybinding_dialog_list); -static struct hierbox_browser_button keybinding_buttons[] = { +static const struct hierbox_browser_button keybinding_buttons[] = { /* [gettext_accelerator_context(.keybinding_buttons)] */ { N_("~Add"), push_kbdbind_add_button, 0 }, { N_("~Delete"), push_hierbox_delete_button, 0 }, diff --git a/src/config/home.c b/src/config/home.c index 9e23afa9..1a6831fe 100644 --- a/src/config/home.c +++ b/src/config/home.c @@ -49,7 +49,8 @@ test_confdir(unsigned char *home, unsigned char *path, if (!path || !*path) return NULL; if (home && *home && !dir_sep(*path)) - confdir = straconcat(home, STRING_DIR_SEP, path, NULL); + confdir = straconcat(home, STRING_DIR_SEP, path, + (unsigned char *) NULL); else confdir = stracpy(path); diff --git a/src/config/kbdbind.c b/src/config/kbdbind.c index 378ba8fa..6a58773e 100644 --- a/src/config/kbdbind.c +++ b/src/config/kbdbind.c @@ -940,7 +940,7 @@ bind_act(unsigned char *keymap_str, const unsigned char *keystroke_str) return NULL; keybinding->flags |= KBDB_WATERMARK; - return straconcat("\"", action, "\"", NULL); + return straconcat("\"", action, "\"", (unsigned char *) NULL); } static void @@ -989,6 +989,9 @@ bind_config_string(struct string *file) } struct module kbdbind_module = struct_module( + /* Because this module is listed in main_modules rather than + * in builtin_modules, its name does not appear in the user + * interface and so need not be translatable. */ /* name: */ "Keyboard Bindings", /* options: */ NULL, /* hooks: */ NULL, diff --git a/src/config/options.c b/src/config/options.c index d9854986..43d22446 100644 --- a/src/config/options.c +++ b/src/config/options.c @@ -159,7 +159,7 @@ static int no_autocreate = 0; /* Get record of option of given name, or NULL if there's no such option. */ struct option * -get_opt_rec(struct option *tree, unsigned char *name_) +get_opt_rec(struct option *tree, const unsigned char *name_) { struct option *option; unsigned char *aname = stracpy(name_); @@ -197,7 +197,7 @@ get_opt_rec(struct option *tree, unsigned char *name_) if (tree && tree->flags & OPT_AUTOCREATE && !no_autocreate) { struct option *template = get_opt_rec(tree, "_template_"); - assertm(template, "Requested %s should be autocreated but " + assertm(template != NULL, "Requested %s should be autocreated but " "%.*s._template_ is missing!", name_, sep - name_, name_); if_assert_failed { @@ -231,7 +231,7 @@ get_opt_rec(struct option *tree, unsigned char *name_) * do not create the option if it doesn't exist and there's autocreation * enabled. */ struct option * -get_opt_rec_real(struct option *tree, unsigned char *name) +get_opt_rec_real(struct option *tree, const unsigned char *name) { struct option *opt; @@ -391,7 +391,7 @@ add_opt_rec(struct option *tree, unsigned char *path, struct option *option) assert(path && option && tree); if (*path) tree = get_opt_rec(tree, path); - assertm(tree, "Missing option tree for '%s'", path); + assertm(tree != NULL, "Missing option tree for '%s'", path); if (!tree->value.tree) return; object_nolock(option, "option"); @@ -680,7 +680,7 @@ register_autocreated_options(void) static struct option_info config_options_info[]; extern struct option_info cmdline_options_info[]; -static struct change_hook_info change_hooks[]; +static const struct change_hook_info change_hooks[]; void init_options(void) @@ -716,7 +716,7 @@ done_options(void) } void -register_change_hooks(struct change_hook_info *change_hooks) +register_change_hooks(const struct change_hook_info *change_hooks) { int i; @@ -955,9 +955,8 @@ toggle_option(struct session *ses, struct option *option) assert(option->type == OPT_BOOL || option->type == OPT_INT); assert(option->max); - /* TODO: call change hooks. --jonas */ option->value.number = (number <= option->max) ? number : option->min; - option_changed(ses, option, option); + option_changed(ses, option); } static int @@ -976,7 +975,7 @@ change_hook_language(struct session *ses, struct option *current, struct option return 0; } -static struct change_hook_info change_hooks[] = { +static const struct change_hook_info change_hooks[] = { { "config.show_template", change_hook_stemplate }, { "connection", change_hook_connection }, { "document.browse", change_hook_html }, @@ -1012,11 +1011,11 @@ call_change_hooks(struct session *ses, struct option *current, struct option *op } void -option_changed(struct session *ses, struct option *current, struct option *option) +option_changed(struct session *ses, struct option *option) { option->flags |= OPT_TOUCHED; /* Notify everyone out there! */ - call_change_hooks(ses, current, option); + call_change_hooks(ses, option, option); } int diff --git a/src/config/options.h b/src/config/options.h index 8123bc96..77e2a157 100644 --- a/src/config/options.h +++ b/src/config/options.h @@ -105,7 +105,19 @@ union option_value { unsigned char *string; }; -typedef int (*change_hook_T)(struct session *, struct option *current, + +/* @session is the session via which the user changed the options, + * or NULL if not known. Because the options are currently not + * session-specific, it is best to ignore this parameter. In a future + * version of ELinks, this parameter might mean the session to which + * the changed options apply. + * + * @current is the option whose change hook is being called. It is + * never NULL. + * + * @changed is the option that was changed, or NULL if multiple + * descendants of @current may have been changed. */ +typedef int (*change_hook_T)(struct session *session, struct option *current, struct option *changed); struct option { @@ -145,7 +157,7 @@ struct change_hook_info { change_hook_T change_hook; }; -extern void register_change_hooks(struct change_hook_info *change_hooks); +extern void register_change_hooks(const struct change_hook_info *change_hooks); extern struct list_head *init_options_tree(void); @@ -180,8 +192,7 @@ void call_change_hooks(struct session *ses, struct option *current, /* Do proper bookkeeping after an option has changed - call this every time * you change an option value. */ -void option_changed(struct session *ses, struct option *current, - struct option *option); +void option_changed(struct session *ses, struct option *option); extern int commit_option_values(struct option_resolver *resolvers, struct option *root, @@ -197,8 +208,8 @@ extern void checkout_option_values(struct option_resolver *resolvers, * use get_opt_type() and add_opt_type(). For command line options, you want to * use get_opt_type_tree(cmdline_options, "option"). */ -extern struct option *get_opt_rec(struct option *, unsigned char *); -extern struct option *get_opt_rec_real(struct option *, unsigned char *); +extern struct option *get_opt_rec(struct option *, const unsigned char *); +extern struct option *get_opt_rec_real(struct option *, const unsigned char *); #ifdef CONFIG_DEBUG extern union option_value *get_opt_(unsigned char *, int, enum option_type, struct option *, unsigned char *); #define get_opt(tree, name, type) get_opt_(__FILE__, __LINE__, type, tree, name) diff --git a/src/config/options.inc b/src/config/options.inc index c2fae4c7..cfbedc85 100644 --- a/src/config/options.inc +++ b/src/config/options.inc @@ -505,11 +505,12 @@ static struct option_info config_options_info[] = { /* FIXME: Write more. */ INIT_OPT_INT("document.cache", N_("Revalidation interval"), "revalidation_interval", 0, -1, 86400, -1, - N_("Period that a cache entry is considered to be up-to-date.\n" - "When a document is loaded and this interval has elapsed since the\n" - "document was initially loaded or most recently revalidated\n" - "with the server, the server will be checked in case there is\n" - "a more up-to-date version of the document.")), + N_("Period in seconds that a cache entry is considered to be\n" + "up-to-date. When a document is loaded and this interval has elapsed\n" + "since the document was initially loaded or most recently\n" + "revalidated with the server, the server will be checked in case\n" + "there is a more up-to-date version of the document.\n\n" + "A value of -1 disables automatic revalidation.")), INIT_OPT_TREE("document.cache", N_("Memory cache"), "memory", 0, @@ -641,80 +642,26 @@ static struct option_info config_options_info[] = { N_("Codepage used in dump output. 'System' stands for\n" "a codepage determined by a selected locale.")), - /* The #if directives cannot be inside the argument list of - * the INIT_OPT_INT macro; that wouldn't be standard C. - * And they especially cannot be inside the argument list of N_; - * xgettext (GNU gettext-tools) 0.14.3 wouldn't support that. */ - /* FIXME: It's totally brainless --witekfl */ -#if defined(CONFIG_88_COLORS) && defined(CONFIG_256_COLORS) && !defined(CONFIG_TRUE_COLOR) INIT_OPT_INT("document.dump", N_("Color mode"), - "color_mode", 0, -1, 3, -1, - N_("Color mode for dumps:\n" - "-1 is standard dump mode\n" - "0 is mono mode\n" - "1 is 16 color mode\n" - "2 is 88 color mode\n" - "3 is 256 color mode")), -#elif defined(CONFIG_88_COLORS) && !defined(CONFIG_256_COLORS) && !defined(CONFIG_TRUE_COLOR) - INIT_OPT_INT("document.dump", N_("Color mode"), - "color_mode", 0, -1, 2, -1, - N_("Color mode for dumps:\n" - "-1 is standard dump mode\n" - "0 is mono mode\n" - "1 is 16 color mode\n" - "2 is 88 color mode")), -#elif defined(CONFIG_256_COLORS) && !defined(CONFIG_88_COLORS) && !defined(CONFIG_TRUE_COLOR) - INIT_OPT_INT("document.dump", N_("Color mode"), - "color_mode", 0, -1, 2, -1, - N_("Color mode for dumps:\n" - "-1 is standard dump mode\n" - "0 is mono mode\n" - "1 is 16 color mode\n" - "2 is 256 color mode")), -#elif !defined(CONFIG_88_COLORS) && !defined(CONFIG_256_COLORS) && !defined(CONFIG_TRUE_COLOR) - INIT_OPT_INT("document.dump", N_("Color mode"), - "color_mode", 0, -1, 1, -1, - N_("Color mode for dumps:\n" - "-1 is standard dump mode\n" - "0 is mono mode\n" - "1 is 16 color mode")), -#elif defined(CONFIG_88_COLORS) && defined(CONFIG_256_COLORS) && defined(CONFIG_TRUE_COLOR) - INIT_OPT_INT("document.dump", N_("Color mode"), - "color_mode", 0, -1, 4, -1, - N_("Color mode for dumps:\n" + "color_mode", 0, -1, COLOR_MODES - 1, -1, + /* The list of modes must be at the end of this string + * because AsciiDoc 7.1.2 does not support continuing + * an outer list entry after an inner list. + * TRANSLATORS: This restriction applies only to the + * "en" (English) translation. (See doc/Makefile.) */ + N_("Color mode for dumps.\n" + "Some modes may have been disabled at compile time. " + "The Setup -> Terminal options dialog lists the modes " + "supported by this executable. If you select an " + "unsupported mode, ELinks uses 16 colors.\n" + "The color modes are:\n" "-1 is standard dump mode\n" "0 is mono mode\n" "1 is 16 color mode\n" "2 is 88 color mode\n" "3 is 256 color mode\n" "4 is true color mode")), -#elif defined(CONFIG_88_COLORS) && !defined(CONFIG_256_COLORS) && defined(CONFIG_TRUE_COLOR) - INIT_OPT_INT("document.dump", N_("Color mode"), - "color_mode", 0, -1, 3, -1, - N_("Color mode for dumps:\n" - "-1 is standard dump mode\n" - "0 is mono mode\n" - "1 is 16 color mode\n" - "2 is 88 color mode\n" - "3 is true color mode")), -#elif defined(CONFIG_256_COLORS) && !defined(CONFIG_88_COLORS) && defined(CONFIG_TRUE_COLOR) - INIT_OPT_INT("document.dump", N_("Color mode"), - "color_mode", 0, -1, 3, -1, - N_("Color mode for dumps:\n" - "-1 is standard dump mode\n" - "0 is mono mode\n" - "1 is 16 color mode\n" - "2 is 256 color mode\n" - "3 is true color mode")), -#elif !defined(CONFIG_88_COLORS) && !defined(CONFIG_256_COLORS) && defined(CONFIG_TRUE_COLOR) - INIT_OPT_INT("document.dump", N_("Color mode"), - "color_mode", 0, -1, 2, -1, - N_("Color mode for dumps:\n" - "-1 is standard dump mode\n" - "0 is mono mode\n" - "1 is 16 color mode\n" - "2 is true color mode")), -#endif /* !defined(CONFIG_88_COLORS) && !defined(CONFIG_256_COLORS) */ + INIT_OPT_STRING("document.dump", N_("Footer"), "footer", 0, "", N_("Footer string used in dumps. %u is substituted by URL.")), @@ -885,14 +832,16 @@ static struct option_info config_options_info[] = { "and lines working at the same time. Makes sense only with linux\n" "terminal.")), + /* When CONFIG_UTF8 is defined, any code that reads the "utf_8_io" + * option should also check whether the "codepage" option is UTF-8, + * and if so, behave as if "utf_8_io" were 1. (When CONFIG_UTF8 is + * not defined, it should not be possible to set UTF-8 as "codepage"; + * please report any such possibilities as bugs.) */ INIT_OPT_BOOL("terminal._template_", N_("UTF-8 I/O"), "utf_8_io", 0, 0, N_("Enable I/O in UTF-8 for Unicode terminals. Note that currently,\n" "only the subset of UTF-8 according to terminal codepage is used.\n" "ELinks ignores this option if the terminal codepage is UTF-8.")), - /* When CONFIG_UTF8 is defined, any code that reads the "utf_8_io" - * option should also check whether the "codepage" option is UTF-8, - * and if so, behave as if "utf_8_io" were 1. */ INIT_OPT_BOOL("terminal._template_", N_("Restrict frames in cp850/852"), "restrict_852", 0, 0, @@ -907,12 +856,23 @@ static struct option_info config_options_info[] = { INIT_OPT_INT("terminal._template_", N_("Color mode"), "colors", 0, 0, COLOR_MODES - 1, 0, - N_("The color mode controls what colors are used and how they are\n" - "output to the terminal. The color modes are:\n" + /* The list of modes must be at the end of this string + * because AsciiDoc 7.1.2 does not support continuing + * an outer list entry after an inner list. + * TRANSLATORS: This restriction applies only to the + * "en" (English) translation. (See doc/Makefile.) */ + N_("The color mode controls what colors are used and how they are " + "output to the terminal.\n" + "Some modes may have been disabled at compile time. " + "The Setup -> Terminal options dialog lists the modes " + "supported by this executable. If you select an " + "unsupported mode, ELinks uses 16 colors.\n" + "The color modes are:\n" "0 is mono mode, only 2 colors are used\n" "1 is 16 color mode, uses the common ANSI colors\n" - "2 is 256 color mode, uses XTerm RGB codes\n" - "3 is true color mode, uses konsole RGB codes.")), + "2 is 88 color mode, uses XTerm RGB codes\n" + "3 is 256 color mode, uses XTerm RGB codes\n" + "4 is true color mode, uses konsole RGB codes")), INIT_OPT_BOOL("terminal._template_", N_("Transparency"), "transparency", 0, 0, diff --git a/src/config/opttypes.c b/src/config/opttypes.c index 5f49ebb3..6c02278b 100644 --- a/src/config/opttypes.c +++ b/src/config/opttypes.c @@ -94,7 +94,7 @@ exec_cmd(struct option *o, unsigned char ***argv, int *argc) { \ struct option *real = get_opt_rec(config_options, opt->value.string); \ \ - assertm(real, "%s aliased to unknown option %s!", opt->name, opt->value.string); \ + assertm(real != NULL, "%s aliased to unknown option %s!", opt->name, opt->value.string); \ if_assert_failed { return ret_; } \ \ if (option_types[real->type].name_) \ @@ -109,7 +109,7 @@ redir_cmd(struct option *opt, unsigned char ***argv, int *argc) struct option *real = get_opt_rec(config_options, opt->value.string); unsigned char * ret = NULL; - assertm(real, "%s aliased to unknown option %s!", opt->name, opt->value.string); + assertm(real != NULL, "%s aliased to unknown option %s!", opt->name, opt->value.string); if_assert_failed { return ret; } if (option_types[real->type].cmdline) { @@ -131,7 +131,7 @@ redir_wr(struct option *opt, struct string *string) { struct option *real = get_opt_rec(config_options, opt->value.string); - assertm(real, "%s aliased to unknown option %s!", opt->name, opt->value.string); + assertm(real != NULL, "%s aliased to unknown option %s!", opt->name, opt->value.string); if_assert_failed { return; } if (option_types[real->type].write) @@ -144,7 +144,7 @@ redir_set(struct option *opt, unsigned char *str) struct option *real = get_opt_rec(config_options, opt->value.string); int ret = 0; - assertm(real, "%s aliased to unknown option %s!", opt->name, opt->value.string); + assertm(real != NULL, "%s aliased to unknown option %s!", opt->name, opt->value.string); if_assert_failed { return ret; } if (option_types[real->type].set) { @@ -166,7 +166,7 @@ redir_add(struct option *opt, unsigned char *str) /* Support functions for config file parsing. */ static void -add_optstring_to_string(struct string *s, unsigned char *q, int qlen) +add_optstring_to_string(struct string *s, const unsigned char *q, int qlen) { if (!commandline) add_char_to_string(s, '"'); add_quoted_to_string(s, q, qlen); @@ -322,7 +322,7 @@ cp_set(struct option *opt, unsigned char *str) static void cp_wr(struct option *o, struct string *s) { - unsigned char *mime_name = get_cp_mime_name(o->value.number); + unsigned char *mime_name = get_cp_config_name(o->value.number); add_optstring_to_string(s, mime_name, strlen(mime_name)); } @@ -364,7 +364,7 @@ color_wr(struct option *opt, struct string *str) { color_T color = opt->value.color; unsigned char hexcolor[8]; - unsigned char *strcolor = get_color_string(color, hexcolor); + const unsigned char *strcolor = get_color_string(color, hexcolor); add_optstring_to_string(str, strcolor, strlen(strcolor)); } diff --git a/src/config/timer.c b/src/config/timer.c index 0a7a9cec..0a36d00e 100644 --- a/src/config/timer.c +++ b/src/config/timer.c @@ -63,7 +63,7 @@ periodic_save_change_hook(struct session *ses, struct option *current, static void init_timer(struct module *module) { - struct change_hook_info timer_change_hooks[] = { + static const struct change_hook_info timer_change_hooks[] = { { "infofiles.save_interval", periodic_save_change_hook }, { NULL, NULL }, }; diff --git a/src/cookies/cookies.c b/src/cookies/cookies.c index 1a31c0c8..7300083e 100644 --- a/src/cookies/cookies.c +++ b/src/cookies/cookies.c @@ -456,9 +456,9 @@ set_cookie(struct uri *uri, unsigned char *str) #ifdef DEBUG_COOKIES { DBG("Got cookie %s = %s from %s, domain %s, " - "expires at %d, secure %d", cookie->name, + "expires at %"TIME_PRINT_FORMAT", secure %d", cookie->name, cookie->value, cookie->server->host, cookie->domain, - cookie->expires, cookie->secure); + (time_print_T) cookie->expires, cookie->secure); } #endif @@ -672,8 +672,8 @@ send_cookies(struct uri *uri) if (c->expires && c->expires <= now) { #ifdef DEBUG_COOKIES - DBG("Cookie %s=%s (exp %d) expired.", - c->name, c->value, c->expires); + DBG("Cookie %s=%s (exp %"TIME_PRINT_FORMAT") expired.", + c->name, c->value, (time_print_T) c->expires); #endif delete_cookie(c); @@ -720,7 +720,8 @@ load_cookies(void) { time_t now; if (elinks_home) { - cookfile = straconcat(elinks_home, cookfile, NULL); + cookfile = straconcat(elinks_home, cookfile, + (unsigned char *) NULL); if (!cookfile) return; } @@ -861,7 +862,8 @@ save_cookies(struct terminal *term) { return; } - cookfile = straconcat(elinks_home, COOKIES_FILENAME, NULL); + cookfile = straconcat(elinks_home, COOKIES_FILENAME, + (unsigned char *) NULL); if (!cookfile) { CANNOT_SAVE_COOKIES(0, N_("Out of memory")); return; @@ -878,12 +880,12 @@ save_cookies(struct terminal *term) { now = time(NULL); foreach (c, cookies) { if (!c->expires || c->expires <= now) continue; - if (secure_fprintf(ssi, "%s\t%s\t%s\t%s\t%s\t%ld\t%d\n", + if (secure_fprintf(ssi, "%s\t%s\t%s\t%s\t%s\t%"TIME_PRINT_FORMAT"\t%d\n", c->name, c->value, c->server->host, empty_string_or_(c->path), empty_string_or_(c->domain), - c->expires, c->secure) < 0) + (time_print_T) c->expires, c->secure) < 0) break; } diff --git a/src/cookies/dialogs.c b/src/cookies/dialogs.c index 3af9c3dc..f4df50c8 100644 --- a/src/cookies/dialogs.c +++ b/src/cookies/dialogs.c @@ -50,6 +50,18 @@ add_cookie_info_to_string(struct string *string, struct cookie *cookie, _(cookie->secure ? N_("yes") : N_("no"), term)); } +static void +accept_cookie_in_msg_box(void *cookie_) +{ + accept_cookie((struct cookie *) cookie_); +} + +static void +reject_cookie_in_msg_box(void *cookie_) +{ + done_cookie((struct cookie *) cookie_); +} + /* TODO: Store cookie in data arg. --jonas*/ void accept_cookie_dialog(struct session *ses, void *data) @@ -78,8 +90,8 @@ accept_cookie_dialog(struct session *ses, void *data) N_("Accept cookie?"), ALIGN_LEFT, string.source, cookie, 2, - N_("~Accept"), accept_cookie, B_ENTER, - N_("~Reject"), done_cookie, B_ESC); + MSG_BOX_BUTTON(N_("~Accept"), accept_cookie_in_msg_box, B_ENTER), + MSG_BOX_BUTTON(N_("~Reject"), reject_cookie_in_msg_box, B_ESC)); } @@ -219,7 +231,7 @@ static struct listbox_ops_messages cookies_messages = { N_("Do you really want to remove all cookies?"), }; -static struct listbox_ops cookies_listbox_ops = { +static const struct listbox_ops cookies_listbox_ops = { lock_cookie, unlock_cookie, is_cookie_used, @@ -280,6 +292,7 @@ set_cookie_expires(struct dialog_data *dlg_data, struct widget_data *widget_data if (!value || !cookie) return EVENT_NOT_PROCESSED; + /* Bug 923: Assumes time_t values fit in long. */ errno = 0; number = strtol(value, (char **) &end, 10); if (errno || *end || number < 0) return EVENT_NOT_PROCESSED; @@ -335,12 +348,14 @@ build_edit_dialog(struct terminal *term, struct cookie *cookie) safe_strncpy(name, cookie->name, MAX_STR_LEN); safe_strncpy(value, cookie->value, MAX_STR_LEN); safe_strncpy(domain, cookie->domain, MAX_STR_LEN); + /* Bug 923: Assumes time_t values fit in unsigned long. */ ulongcat(expires, &length, cookie->expires, MAX_STR_LEN, 0); length = 0; ulongcat(secure, &length, cookie->secure, MAX_STR_LEN, 0); dlg_server = cookie->server->host; - dlg_server = straconcat(_("Server", term), ": ", dlg_server, "\n", NULL); + dlg_server = straconcat(_("Server", term), ": ", dlg_server, "\n", + (unsigned char *) NULL); if (!dlg_server) { mem_free(dlg); @@ -359,7 +374,7 @@ build_edit_dialog(struct terminal *term, struct cookie *cookie) add_dlg_end(dlg, EDIT_WIDGETS_COUNT); - do_dialog(term, dlg, getml(dlg, dlg_server, NULL)); + do_dialog(term, dlg, getml(dlg, (void *) dlg_server, (void *) NULL)); #undef EDIT_WIDGETS_COUNT } @@ -455,7 +470,7 @@ push_add_server_button(struct dialog_data *dlg_data, struct widget_data *button) add_dlg_ok_button(dlg, _("~OK", term), B_ENTER, add_server_do, name); add_dlg_button(dlg, _("~Cancel", term), B_ESC, cancel_dialog, NULL); add_dlg_end(dlg, SERVER_WIDGETS_COUNT); - do_dialog(term, dlg, getml(dlg, NULL)); + do_dialog(term, dlg, getml(dlg, (void *) NULL)); return EVENT_PROCESSED; #undef SERVER_WIDGETS_COUNT @@ -469,7 +484,7 @@ push_save_button(struct dialog_data *dlg_data, struct widget_data *button) return EVENT_PROCESSED; } -static struct hierbox_browser_button cookie_buttons[] = { +static const struct hierbox_browser_button cookie_buttons[] = { /* [gettext_accelerator_context(.cookie_buttons)] */ { N_("~Info"), push_hierbox_info_button, 1 }, { N_("~Add"), push_add_button, 1 }, diff --git a/src/dialogs/download.c b/src/dialogs/download.c index a9369962..2d177b39 100644 --- a/src/dialogs/download.c +++ b/src/dialogs/download.c @@ -270,7 +270,7 @@ display_download(struct terminal *term, struct file_download *file_download, add_dlg_end(dlg, DOWNLOAD_WIDGETS_COUNT - !!file_download->external_handler); #endif - do_dialog(term, dlg, getml(dlg, NULL)); + do_dialog(term, dlg, getml(dlg, (void *) NULL)); } @@ -445,7 +445,7 @@ static struct listbox_ops_messages download_messages = { N_("Do you really want to interrupt all downloads?"), }; -static struct listbox_ops downloads_listbox_ops = { +static const struct listbox_ops downloads_listbox_ops = { lock_file_download, unlock_file_download, is_file_download_used, @@ -487,7 +487,7 @@ push_info_button(struct dialog_data *dlg_data, struct widget_data *button) * - Open button that can be used to set file_download->prog. * - Toggle notify button */ -static struct hierbox_browser_button download_buttons[] = { +static const struct hierbox_browser_button download_buttons[] = { /* [gettext_accelerator_context(.download_buttons)] */ { N_("~Info"), push_info_button }, { N_("~Abort"), push_hierbox_delete_button }, diff --git a/src/dialogs/edit.c b/src/dialogs/edit.c index b920760f..1787cf6c 100644 --- a/src/dialogs/edit.c +++ b/src/dialogs/edit.c @@ -107,7 +107,7 @@ do_edit_dialog(struct terminal *term, int intl, unsigned char *title, add_dlg_end(dlg, EDIT_WIDGETS_COUNT); - do_dialog(term, dlg, getml(dlg, NULL)); + do_dialog(term, dlg, getml(dlg, (void *) NULL)); #undef EDIT_WIDGETS_COUNT } diff --git a/src/dialogs/info.c b/src/dialogs/info.c index f9b6e8b4..f987aee0 100644 --- a/src/dialogs/info.c +++ b/src/dialogs/info.c @@ -127,12 +127,12 @@ menu_keys(struct terminal *term, void *d_, void *xxx) add_actions_to_string(&keys, action_ids, KEYMAP_MAIN, term); } - msg_box(term, getml(info, NULL), MSGBOX_FREE_TEXT | MSGBOX_SCROLLABLE, + msg_box(term, getml(info, (void *) NULL), MSGBOX_FREE_TEXT | MSGBOX_SCROLLABLE, N_("Keys"), ALIGN_LEFT, keys.source, info, 2, - N_("~OK"), NULL, B_ENTER | B_ESC, - N_("~Toggle display"), push_toggle_keys_display_button, B_ENTER); + MSG_BOX_BUTTON(N_("~OK"), NULL, B_ENTER | B_ESC), + MSG_BOX_BUTTON(N_("~Toggle display"), push_toggle_keys_display_button, B_ENTER)); } void diff --git a/src/dialogs/menu.c b/src/dialogs/menu.c index 101d97e7..615e66e3 100644 --- a/src/dialogs/menu.c +++ b/src/dialogs/menu.c @@ -100,15 +100,19 @@ save_url_as(struct session *ses) NULL); } -void -really_exit_prog(struct session *ses) +static void +really_exit_prog(void *ses_) { + struct session *ses = ses_; + register_bottom_half(destroy_terminal, ses->tab->term); } static inline void -dont_exit_prog(struct session *ses) +dont_exit_prog(void *ses_) { + struct session *ses = ses_; + ses->exit_query = 0; } @@ -124,8 +128,8 @@ query_exit(struct session *ses) "(and terminate all downloads)?") : N_("Do you really want to exit ELinks?"), ses, 2, - N_("~Yes"), (void (*)(void *)) really_exit_prog, B_ENTER, - N_("~No"), (void (*)(void *)) dont_exit_prog, B_ESC); + MSG_BOX_BUTTON(N_("~Yes"), really_exit_prog, B_ENTER), + MSG_BOX_BUTTON(N_("~No"), dont_exit_prog, B_ESC)); } void diff --git a/src/dialogs/menu.h b/src/dialogs/menu.h index 4d0077bd..c5848c60 100644 --- a/src/dialogs/menu.h +++ b/src/dialogs/menu.h @@ -24,7 +24,6 @@ void free_history_lists(void); void query_file(struct session *, struct uri *, void *, void (*)(void *, unsigned char *), void (*)(void *), int); -void really_exit_prog(struct session *ses); void query_exit(struct session *ses); void exit_prog(struct session *ses, int query); diff --git a/src/dialogs/options.c b/src/dialogs/options.c index 93ca7afb..75a59a8b 100644 --- a/src/dialogs/options.c +++ b/src/dialogs/options.c @@ -37,9 +37,7 @@ display_codepage(struct terminal *term, void *name_, void *xxx) if (opt->value.number != index) { opt->value.number = index; - /* TODO: option_changed() (we need to review the hooks - * to handle NULL ses or properly document that stuff). */ - opt->flags |= OPT_TOUCHED; + option_changed(NULL, opt); } cls_redraw_all_terminals(); @@ -50,7 +48,9 @@ charset_list(struct terminal *term, void *xxx, void *ses_) { struct session *ses = ses_; int i, items; - int sel = int_max(0, get_opt_codepage_tree(term->spec, "charset")); + int sel = 0; + const unsigned char *const sel_mime = get_cp_mime_name( + get_opt_codepage_tree(term->spec, "charset")); struct menu_item *mi = new_menu(FREE_LIST); if (!mi) return; @@ -64,16 +64,16 @@ charset_list(struct terminal *term, void *xxx, void *ses_) if (is_cp_utf8(i)) continue; #endif /* CONFIG_UTF8 */ + /* Map the "System" codepage to the underlying one. + * A pointer comparison might suffice here but this + * code is not time-critical. */ + if (strcmp(sel_mime, get_cp_mime_name(i)) == 0) + sel = items; items++; add_to_menu(&mi, name, NULL, ACT_MAIN_NONE, - display_codepage, get_cp_mime_name(i), 0); + display_codepage, get_cp_config_name(i), 0); } - /* Special codepages are not in the menu and it may cause assertion - * failures later if the selected item is out of bound. */ - if (sel >= items) - sel = 0; - do_menu_selected(term, mi, ses, sel, 0); } @@ -238,7 +238,7 @@ terminal_options(struct terminal *term, void *xxx, struct session *ses) add_dlg_end(dlg, TERMOPT_WIDGETS_COUNT - anonymous); - do_dialog(term, dlg, getml(dlg, NULL)); + do_dialog(term, dlg, getml(dlg, (void *) NULL)); } #ifdef CONFIG_NLS @@ -317,5 +317,5 @@ resize_terminal_dialog(struct terminal *term) add_dlg_end(dlg, RESIZE_WIDGETS_COUNT); - do_dialog(term, dlg, getml(dlg, NULL)); + do_dialog(term, dlg, getml(dlg, (void *) NULL)); } diff --git a/src/dialogs/status.c b/src/dialogs/status.c index cd73a042..84a2c1c0 100644 --- a/src/dialogs/status.c +++ b/src/dialogs/status.c @@ -152,7 +152,8 @@ get_current_link_info_and_title(struct session *ses, if (link_title) { assert(*link_title); - ret = straconcat(link_info, " - ", link_title, NULL); + ret = straconcat(link_info, " - ", link_title, + (unsigned char *) NULL); mem_free(link_info); mem_free(link_title); } @@ -482,7 +483,8 @@ display_window_title(struct session *ses, struct terminal *term) && ses->doc_view->document->title[0]) doc_title = ses->doc_view->document->title; - title = doc_title ? straconcat(doc_title, " - ELinks", NULL) + title = doc_title ? straconcat(doc_title, " - ELinks", + (unsigned char *) NULL) : stracpy("ELinks"); if (!title) return; diff --git a/src/document/css/css.c b/src/document/css/css.c index 42c9ef35..cf6cf084 100644 --- a/src/document/css/css.c +++ b/src/document/css/css.c @@ -19,6 +19,7 @@ #include "main/module.h" #include "network/connection.h" #include "protocol/uri.h" +#include "session/session.h" #include "util/error.h" #include "util/memory.h" #include "viewer/text/draw.h" @@ -127,7 +128,10 @@ change_hook_css(struct session *ses, struct option *current, struct option *chan import_default_css(); } - draw_formatted(ses, 1); + /* Instead of using the value of the @ses parameter, iterate + * through the @sessions list. The parameter may be NULL and + * anyway we don't support session-specific options yet. */ + foreach (ses, sessions) draw_formatted(ses, 1); return 0; } @@ -135,7 +139,7 @@ change_hook_css(struct session *ses, struct option *current, struct option *chan static void init_css(struct module *module) { - struct change_hook_info css_change_hooks[] = { + static const struct change_hook_info css_change_hooks[] = { { "document.css", change_hook_css }, { NULL, NULL }, }; diff --git a/src/document/document.c b/src/document/document.c index 966b8093..9c0d4d75 100644 --- a/src/document/document.c +++ b/src/document/document.c @@ -342,6 +342,9 @@ done_documents(struct module *module) } struct module document_module = struct_module( + /* Because this module is listed in main_modules rather than + * in builtin_modules, its name does not appear in the user + * interface and so need not be translatable. */ /* name: */ "Document", /* options: */ NULL, /* hooks: */ NULL, diff --git a/src/document/html/parser.c b/src/document/html/parser.c index b9bafb2a..ca25f8ed 100644 --- a/src/document/html/parser.c +++ b/src/document/html/parser.c @@ -561,7 +561,7 @@ look_for_link(unsigned char **pos, unsigned char *eof, struct menu_item **menu, } else if (!strlcasecmp(name, namelen, "/MAP", 4)) { /* This is the only successful return from here! */ - add_to_ml(ml, *menu, NULL); + add_to_ml(ml, (void *) *menu, (void *) NULL); return 0; } else { @@ -644,7 +644,8 @@ look_for_link(unsigned char **pos, unsigned char *eof, struct menu_item **menu, nm[nmenu].flags = NO_INTL; } - add_to_ml(ml, ld, ld->link, ld->target, label, NULL); + add_to_ml(ml, (void *) ld, (void *) ld->link, (void *) ld->target, + (void *) label, (void *) NULL); return 1; } diff --git a/src/document/html/parser/link.c b/src/document/html/parser/link.c index 2cecdf83..1c7911ff 100644 --- a/src/document/html/parser/link.c +++ b/src/document/html/parser/link.c @@ -232,7 +232,8 @@ html_img_do(unsigned char *a, unsigned char *object_src, mem_free(usemap_attr); if (!joined_urls) return; - map_url = straconcat("MAP@", joined_urls, NULL); + map_url = straconcat("MAP@", joined_urls, + (unsigned char *) NULL); mem_free(joined_urls); if (!map_url) return; @@ -308,7 +309,7 @@ html_img_do(unsigned char *a, unsigned char *object_src, if (img_link_tag && (img_link_tag == 2 || add_brackets)) { unsigned char *img_link_prefix = options->image_link.prefix; unsigned char *img_link_suffix = options->image_link.suffix; - unsigned char *new_label = straconcat(img_link_prefix, label, img_link_suffix, NULL); + unsigned char *new_label = straconcat(img_link_prefix, label, img_link_suffix, (unsigned char *) NULL); if (new_label) mem_free_set(&label, new_label); } @@ -327,7 +328,7 @@ html_img_do(unsigned char *a, unsigned char *object_src, unsigned char *new_link; html_stack_dup(html_context, ELEMENT_KILLABLE); - new_link = straconcat(format.link, "?0,0", NULL); + new_link = straconcat(format.link, "?0,0", (unsigned char *) NULL); if (new_link) mem_free_set(&format.link, new_link); } diff --git a/src/document/html/parser/parse.c b/src/document/html/parser/parse.c index 46e636f8..135f6459 100644 --- a/src/document/html/parser/parse.c +++ b/src/document/html/parser/parse.c @@ -211,7 +211,7 @@ found_endattr: mem_free(saved_attr); } - set_mem_comment(trim_chars(attr, ' ', NULL), name, strlen(name)); + set_mem_comment(attr, name, strlen(name)); return attr; } else { diff --git a/src/document/html/renderer.c b/src/document/html/renderer.c index 0108f8ba..dfd7f625 100644 --- a/src/document/html/renderer.c +++ b/src/document/html/renderer.c @@ -154,14 +154,16 @@ realloc_line(struct html_context *html_context, struct document *document, { struct screen_char *pos, *end; struct line *line; + int orig_length; if (!realloc_lines(document, y)) return -1; line = &document->data[y]; - - if (length < line->length) - return 0; + orig_length = line->length; + + if (length < orig_length) + return orig_length; if (!ALIGN_LINE(&line->chars, line->length, length + 1)) return -1; @@ -181,7 +183,7 @@ realloc_line(struct html_context *html_context, struct document *document, line->length = length + 1; - return 0; + return orig_length; } void @@ -244,7 +246,7 @@ clear_hchars(struct html_context *html_context, int x, int y, int width) assert(part && part->document && width > 0); if_assert_failed return; - if (realloc_line(html_context, part->document, Y(y), X(x) + width - 1)) + if (realloc_line(html_context, part->document, Y(y), X(x) + width - 1) < 0) return; assert(part->document->data); @@ -277,7 +279,7 @@ get_frame_char(struct html_context *html_context, struct part *part, assert(part && part->document && x >= 0 && y >= 0); if_assert_failed return NULL; - if (realloc_line(html_context, part->document, Y(y), X(x))) + if (realloc_line(html_context, part->document, Y(y), X(x)) < 0) return NULL; assert(part->document->data); @@ -325,7 +327,7 @@ draw_frame_vchars(struct part *part, int x, int y, int height, /* The template char is the first vertical char to be drawn. So * copy it to the rest. */ for (height -= 1, y += 1; height; height--, y++) { - if (realloc_line(html_context, part->document, Y(y), X(x))) + if (realloc_line(html_context, part->document, Y(y), X(x)) < 0) return; copy_screen_chars(&POS(x, y), template, 1); @@ -386,14 +388,15 @@ static inline int set_hline(struct html_context *html_context, unsigned char *chars, int charslen, enum link_state link_state) { - struct part *part = html_context->part; - struct screen_char *schar = get_format_screen_char(html_context, - link_state); + struct part *const part = html_context->part; + struct screen_char *const schar = get_format_screen_char(html_context, + link_state); int x = part->cx; - int y = part->cy; - int x2 = x; + const int y = part->cy; + const int x2 = x; int len = charslen; - int utf8 = html_context->options->utf8; + const int utf8 = html_context->options->utf8; + int orig_length; assert(part); if_assert_failed return len; @@ -404,8 +407,21 @@ set_hline(struct html_context *html_context, unsigned char *chars, int charslen, return 0; if (part->document) { - if (realloc_line(html_context, part->document, - Y(y), X(x) + charslen - 1)) + /* Reallocate LINE(y).chars[] to large enough. The + * last parameter of realloc_line is the index of the + * last element to which we may want to write, + * i.e. one less than the required size of the array. + * Compute the required size by assuming that each + * byte of input will need at most one character cell. + * (All double-cell characters take up at least two + * bytes in UTF-8, and there are no triple-cell or + * wider characters.) However, if there already is an + * incomplete character in part->document->buf, then + * the first byte of input can result in a double-cell + * character, so we must reserve one extra element. */ + orig_length = realloc_line(html_context, part->document, + Y(y), X(x) + charslen); + if (orig_length < 0) /* error */ return 0; if (utf8) { unsigned char *end = chars + charslen; @@ -424,61 +440,71 @@ set_hline(struct html_context *html_context, unsigned char *chars, int charslen, part->document->buf[i] = '\0'; data = utf8_to_unicode(&buf_ptr, buf_ptr + i); if (data != UCS_NO_CHAR) { + /* FIXME: If there was invalid + * UTF-8 in the buffer, + * @utf8_to_unicode may have left + * some bytes unused. Those + * bytes should be pulled back + * into @chars, rather than + * discarded. This is not + * trivial to implement because + * each byte may have arrived in + * a separate call. */ part->document->buf_length = 0; goto good_char; } else { /* Still not full char */ + LINE(y).length = orig_length; return 0; } } for (; chars < end; x++) { - if (*chars == NBSP_CHAR) { - schar->data = ' '; - part->spaces[x] = html_context->options->wrap_nbsp; - part->char_width[x] = 1; - chars++; - } else { - part->spaces[x] = (*chars == ' '); - data = utf8_to_unicode(&chars, end); - if (data == UCS_NO_CHAR) { - if (charslen == 1) { - /* HR */ - unsigned char attr = schar->attr; + /* ELinks does not use NBSP_CHAR in UTF-8. */ - schar->data = *chars++; - schar->attr = SCREEN_ATTR_FRAME; - copy_screen_chars(&POS(x, y), schar, 1); - schar->attr = attr; - part->char_width[x] = 0; - continue; - } else { - unsigned char i; + data = utf8_to_unicode(&chars, end); + if (data == UCS_NO_CHAR) { + part->spaces[x] = 0; + if (charslen == 1) { + /* HR */ + unsigned char attr = schar->attr; - for (i = 0; chars < end;i++) { - part->document->buf[i] = *chars++; - } - part->document->buf_length = i; - return x - x2; - } + schar->data = *chars++; + schar->attr = SCREEN_ATTR_FRAME; + copy_screen_chars(&POS(x, y), schar, 1); + schar->attr = attr; + part->char_width[x] = 0; + continue; } else { -good_char: - if (unicode_to_cell(data) == 2) { - schar->data = (unicode_val_T)data; - part->char_width[x] = 2; - copy_screen_chars(&POS(x++, y), schar, 1); - schar->data = UCS_NO_CHAR; - part->spaces[x] = 0; - part->char_width[x] = 0; - } else { - part->char_width[x] = unicode_to_cell(data); - schar->data = (unicode_val_T)data; + unsigned char i; + + for (i = 0; chars < end;i++) { + part->document->buf[i] = *chars++; } + part->document->buf_length = i; + break; + } + } else { +good_char: + if (data == UCS_NO_BREAK_SPACE + && html_context->options->wrap_nbsp) + data = UCS_SPACE; + part->spaces[x] = (data == UCS_SPACE); + if (unicode_to_cell(data) == 2) { + schar->data = (unicode_val_T)data; + part->char_width[x] = 2; + copy_screen_chars(&POS(x++, y), schar, 1); + schar->data = UCS_NO_CHAR; + part->spaces[x] = 0; + part->char_width[x] = 0; + } else { + part->char_width[x] = unicode_to_cell(data); + schar->data = (unicode_val_T)data; } } copy_screen_chars(&POS(x, y), schar, 1); } - } else { + } else { /* not UTF-8 */ for (; charslen > 0; charslen--, x++, chars++) { part->char_width[x] = 1; if (*chars == NBSP_CHAR) { @@ -490,10 +516,24 @@ good_char: } copy_screen_chars(&POS(x, y), schar, 1); } + } /* end of UTF-8 check */ - } + /* Assert that we haven't written past the end of the + * LINE(y).chars array. @x here is one greater than + * the last one used in POS(x, y). Instead of this, + * we could assert(X(x) < LINE(y).length) immediately + * before each @copy_screen_chars call above, but + * those are in an inner loop that should be fast. */ + assert(X(x) <= LINE(y).length); + /* Some part of the code is apparently using LINE(y).length + * for line-wrapping decisions. It may currently be too + * large because it was allocated above based on @charslen + * which is the number of bytes, not the number of cells. + * Change the length to the correct size, but don't let it + * get smaller than it was on entry to this function. */ + LINE(y).length = int_max(orig_length, X(x)); len = x - x2; - } else { + } else { /* part->document == NULL */ if (utf8) { unsigned char *end; @@ -514,13 +554,13 @@ good_char: } } len = x - x2; - } else { + } else { /* not UTF-8 */ for (; charslen > 0; charslen--, x++, chars++) { part->spaces[x] = (*chars == ' '); part->char_width[x] = 1; } } - } + } /* end of part->document check */ return len; } #else @@ -545,7 +585,7 @@ set_hline(struct html_context *html_context, unsigned char *chars, int charslen, if (part->document) { if (realloc_line(html_context, part->document, - Y(y), X(x) + charslen - 1)) + Y(y), X(x) + charslen - 1) < 0) return; for (; charslen > 0; charslen--, x++, chars++) { @@ -694,7 +734,7 @@ copy_chars(struct html_context *html_context, int x, int y, int width, struct sc assert(width > 0 && part && part->document && part->document->data); if_assert_failed return; - if (realloc_line(html_context, part->document, Y(y), X(x) + width - 1)) + if (realloc_line(html_context, part->document, Y(y), X(x) + width - 1) < 0) return; copy_screen_chars(&POS(x, y), d, width); @@ -1369,7 +1409,8 @@ process_link(struct html_context *html_context, enum link_state link_state, if (name) { unsigned char *new_name; - new_name = straconcat(name, chars, NULL); + new_name = straconcat(name, chars, + (unsigned char *) NULL); if (new_name) { mem_free(name); link->data.name = new_name; @@ -1930,7 +1971,11 @@ html_special(struct html_context *html_context, enum html_special_type c, ...) unsigned long seconds = va_arg(l, unsigned long); unsigned char *t = va_arg(l, unsigned char *); - document->refresh = init_document_refresh(t, seconds); + if (document) { + if (document->refresh) + done_document_refresh(document->refresh); + document->refresh = init_document_refresh(t, seconds); + } break; } case SP_COLOR_LINK_LINES: diff --git a/src/document/html/tables.c b/src/document/html/tables.c index c5b9a3df..26515530 100644 --- a/src/document/html/tables.c +++ b/src/document/html/tables.c @@ -196,7 +196,7 @@ again: } if (wanted) { - assertm(limits, "bug in distribute_values()"); + assertm(limits != NULL, "bug in distribute_values()"); limits = NULL; sum = 0; goto again; diff --git a/src/document/plain/renderer.c b/src/document/plain/renderer.c index dc54f272..3d4cde91 100644 --- a/src/document/plain/renderer.c +++ b/src/document/plain/renderer.c @@ -123,7 +123,7 @@ check_link_word(struct document *document, unsigned char *uri, int length, uri[length] = 0; if (mailto && mailto > uri && mailto - uri < length - 1) { - where = straconcat("mailto:", uri, NULL); + where = straconcat("mailto:", uri, (unsigned char *) NULL); } else if (parse_uri(&test, uri) == URI_ERRNO_OK && test.protocol != PROTOCOL_UNKNOWN diff --git a/src/dom/node.c b/src/dom/node.c index 6f97cfb6..f77a8d78 100644 --- a/src/dom/node.c +++ b/src/dom/node.c @@ -371,7 +371,7 @@ init_dom_node_at( int sort = (type == DOM_NODE_ATTRIBUTE); int index; - assertm(list, "Adding node %d to bad parent %d", + assertm(list != NULL, "Adding node %d to bad parent %d", node->type, parent->type); index = *list && (*list)->size > 0 && sort diff --git a/src/dom/select.c b/src/dom/select.c index 472bd07f..b7b7e599 100644 --- a/src/dom/select.c +++ b/src/dom/select.c @@ -488,7 +488,7 @@ parse_dom_select(struct dom_select *select, struct dom_stack *stack, int sort = (node->type == DOM_NODE_ATTRIBUTE); int index; - assertm(list, "Adding node to bad parent [%d -> %d]", + assertm(list != NULL, "Adding node to bad parent [%d -> %d]", node->type, parent->type); index = *list && (*list)->size > 0 && sort diff --git a/src/dom/stack.h b/src/dom/stack.h index 2e5b24c9..820bbb46 100644 --- a/src/dom/stack.h +++ b/src/dom/stack.h @@ -189,7 +189,7 @@ get_dom_stack_state_data(struct dom_stack_context *context, if (!object_size) return NULL; - assertm(context->state_objects); + assert(context->state_objects); return (void *) &context->state_objects[state->depth * object_size]; } diff --git a/src/ecmascript/Makefile b/src/ecmascript/Makefile index 6581d82a..c5ca6ea0 100644 --- a/src/ecmascript/Makefile +++ b/src/ecmascript/Makefile @@ -1,6 +1,6 @@ top_builddir=../.. include $(top_builddir)/Makefile.config -INCLUDES += $(SPIDERMONKEY_CFLAGS) +INCLUDES += $(SPIDERMONKEY_CFLAGS) $(SEE_CFLAGS) SUBDIRS-$(CONFIG_ECMASCRIPT_SEE) += see SUBDIRS-$(CONFIG_ECMASCRIPT_SMJS) += spidermonkey diff --git a/src/ecmascript/ecmascript.c b/src/ecmascript/ecmascript.c index eeda6f0e..0ef64f70 100644 --- a/src/ecmascript/ecmascript.c +++ b/src/ecmascript/ecmascript.c @@ -43,7 +43,7 @@ static struct option_info ecmascript_options[] = { N_("ECMAScript options.")), INIT_OPT_BOOL("ecmascript", N_("Enable"), - "enable", 0, 1, + "enable", 0, 0, N_("Whether to run those scripts inside of documents.")), INIT_OPT_BOOL("ecmascript", N_("Script error reporting"), @@ -285,10 +285,10 @@ ecmascript_set_action(unsigned char **action, unsigned char *string) struct uri *uri = get_uri(*action, URI_HTTP_REFERRER_HOST); if (uri->protocol == PROTOCOL_FILE) { - mem_free_set(action, straconcat(struri(uri), string, NULL)); + mem_free_set(action, straconcat(struri(uri), string, (unsigned char *) NULL)); } else - mem_free_set(action, straconcat(struri(uri), string + 1, NULL)); + mem_free_set(action, straconcat(struri(uri), string + 1, (unsigned char *) NULL)); done_uri(uri); mem_free(string); } else { /* relative uri */ @@ -296,7 +296,8 @@ ecmascript_set_action(unsigned char **action, unsigned char *string) unsigned char *new_action; if (last_slash) *(last_slash + 1) = '\0'; - new_action = straconcat(*action, string, NULL); + new_action = straconcat(*action, string, + (unsigned char *) NULL); mem_free_set(action, new_action); mem_free(string); } @@ -311,7 +312,9 @@ ecmascript_timeout_handler(void *i) { struct ecmascript_interpreter *interpreter = i; - assertm(interpreter->vs->doc_view, "setTimeout: vs with no document (e_f %d)", interpreter->vs->ecmascript_fragile); + assertm(interpreter->vs->doc_view != NULL, + "setTimeout: vs with no document (e_f %d)", + interpreter->vs->ecmascript_fragile); interpreter->vs->doc_view->document->timeout = TIMER_ID_UNDEF; /* The expired timer ID has now been erased. */ diff --git a/src/ecmascript/see.c b/src/ecmascript/see.c index fd1ae07d..863ed683 100644 --- a/src/ecmascript/see.c +++ b/src/ecmascript/see.c @@ -181,7 +181,7 @@ see_eval_boolback(struct ecmascript_interpreter *interpreter, } struct module see_module = struct_module( - /* name: */ "SEE", + /* name: */ N_("SEE"), /* options: */ NULL, /* events: */ NULL, /* submodules: */ NULL, diff --git a/src/ecmascript/see/Makefile b/src/ecmascript/see/Makefile index 257f9bee..f933a548 100644 --- a/src/ecmascript/see/Makefile +++ b/src/ecmascript/see/Makefile @@ -1,5 +1,6 @@ top_builddir=../../.. include $(top_builddir)/Makefile.config +INCLUDES += $(SEE_CFLAGS) OBJS = checktype.o document.o form.o input.o location.o navigator.o strings.o unibar.o window.o diff --git a/src/ecmascript/see/checktype.c b/src/ecmascript/see/checktype.c index 5e7ff9eb..6c1fc700 100644 --- a/src/ecmascript/see/checktype.c +++ b/src/ecmascript/see/checktype.c @@ -1,3 +1,5 @@ +/* Check the type of a SEE object so it's safe to cast */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/src/ecmascript/spidermonkey.c b/src/ecmascript/spidermonkey.c index 2bf882b9..b326f69f 100644 --- a/src/ecmascript/spidermonkey.c +++ b/src/ecmascript/spidermonkey.c @@ -312,7 +312,7 @@ spidermonkey_eval_boolback(struct ecmascript_interpreter *interpreter, } struct module spidermonkey_module = struct_module( - /* name: */ "SpiderMonkey", + /* name: */ N_("SpiderMonkey"), /* options: */ NULL, /* events: */ NULL, /* submodules: */ NULL, diff --git a/src/encoding/bzip2.c b/src/encoding/bzip2.c index 0291a391..9df4c658 100644 --- a/src/encoding/bzip2.c +++ b/src/encoding/bzip2.c @@ -12,6 +12,7 @@ #ifdef HAVE_BZLIB_H #include /* Everything needs this after stdio.h */ #endif +#include #include "elinks.h" @@ -19,30 +20,55 @@ #include "encoding/encoding.h" #include "util/memory.h" +/* How many bytes of compressed data to read before decompressing. + * This is currently defined as BZ_MAX_UNUSED to make the behaviour + * similar to BZ2_bzRead; but other values would work too. */ +#define ELINKS_BZ_BUFFER_LENGTH BZ_MAX_UNUSED struct bz2_enc_data { - FILE *file; - BZFILE *bzfile; - int last_read; /* If err after last bzRead() was BZ_STREAM_END.. */ -}; + bz_stream fbz_stream; -/* TODO: When it'll be official, use bzdopen() from Yoshioka Tsuneo. --pasky */ + /* The file descriptor from which we read. */ + int fdread; + + /* Initially 0; set to 1 when BZ2_bzDecompress indicates + * BZ_STREAM_END, which means it has found the bzip2-specific + * end-of-stream marker and all data has been decompressed. + * Then we neither read from the file nor call BZ2_bzDecompress + * any more. */ + int last_read; + + /* A buffer for data that has been read from the file but not + * yet decompressed. fbz_stream.next_in and fbz_stream.avail_in + * refer to this buffer. */ + unsigned char buf[ELINKS_BZ_BUFFER_LENGTH]; +}; static int bzip2_open(struct stream_encoded *stream, int fd) { + /* A zero-initialized bz_stream. The compiler ensures that all + * pointer members in it are null. (Can't do this with memset + * because C99 does not require all-bits-zero to be a null + * pointer.) */ + static const bz_stream null_bz_stream = {0}; + struct bz2_enc_data *data = mem_alloc(sizeof(*data)); int err; + stream->data = NULL; if (!data) { return -1; } + + /* Initialize all members of *data, except data->buf[], which + * will be initialized on demand by bzip2_read. */ + copy_struct(&data->fbz_stream, &null_bz_stream); + data->fdread = fd; data->last_read = 0; - - data->file = fdopen(fd, "rb"); - - data->bzfile = BZ2_bzReadOpen(&err, data->file, 0, 0, NULL, 0); - if (!data->bzfile) { + + err = BZ2_bzDecompressInit(&data->fbz_stream, 0, 0); + if (err != BZ_OK) { mem_free(data); return -1; } @@ -58,25 +84,45 @@ bzip2_read(struct stream_encoded *stream, unsigned char *buf, int len) struct bz2_enc_data *data = (struct bz2_enc_data *) stream->data; int err = 0; - if (data->last_read) - return 0; + if (!data) return -1; - len = BZ2_bzRead(&err, data->bzfile, buf, len); + assert(len > 0); - if (err == BZ_STREAM_END) - data->last_read = 1; - else if (err) - return -1; + if (data->last_read) return 0; - return len; -} + data->fbz_stream.avail_out = len; + data->fbz_stream.next_out = buf; -static unsigned char * -bzip2_decode(struct stream_encoded *stream, unsigned char *data, int len, - int *new_len) -{ - *new_len = len; - return data; + do { + if (data->fbz_stream.avail_in == 0) { + int l = safe_read(data->fdread, data->buf, + ELINKS_BZ_BUFFER_LENGTH); + + if (l == -1) { + if (errno == EAGAIN) + break; + else + return -1; /* I/O error */ + } else if (l == 0) { + /* EOF. It is error: we wait for more bytes */ + return -1; + } + + data->fbz_stream.next_in = data->buf; + data->fbz_stream.avail_in = l; + } + + err = BZ2_bzDecompress(&data->fbz_stream); + if (err == BZ_STREAM_END) { + data->last_read = 1; + break; + } else if (err != BZ_OK) { + return -1; + } + } while (data->fbz_stream.avail_out > 0); + + assert(len - data->fbz_stream.avail_out == data->fbz_stream.next_out - (char *) buf); + return len - data->fbz_stream.avail_out; } #ifdef CONFIG_SMALL @@ -148,21 +194,22 @@ static void bzip2_close(struct stream_encoded *stream) { struct bz2_enc_data *data = (struct bz2_enc_data *) stream->data; - int err; - BZ2_bzReadClose(&err, data->bzfile); - fclose(data->file); - mem_free(data); + if (data) { + BZ2_bzDecompressEnd(&data->fbz_stream); + close(data->fdread); + mem_free(data); + stream->data = 0; + } } -static unsigned char *bzip2_extensions[] = { ".bz2", ".tbz", NULL }; +static const unsigned char *const bzip2_extensions[] = { ".bz2", ".tbz", NULL }; -struct decoding_backend bzip2_decoding_backend = { +const struct decoding_backend bzip2_decoding_backend = { "bzip2", bzip2_extensions, bzip2_open, bzip2_read, - bzip2_decode, bzip2_decode_buffer, bzip2_close, }; diff --git a/src/encoding/bzip2.h b/src/encoding/bzip2.h index 2718b249..1367500e 100644 --- a/src/encoding/bzip2.h +++ b/src/encoding/bzip2.h @@ -4,7 +4,7 @@ #include "encoding/encoding.h" #ifdef CONFIG_BZIP2 -extern struct decoding_backend bzip2_decoding_backend; +extern const struct decoding_backend bzip2_decoding_backend; #else #define bzip2_decoding_backend dummy_decoding_backend #endif diff --git a/src/encoding/encoding.c b/src/encoding/encoding.c index 5e00cd89..42dc62b1 100644 --- a/src/encoding/encoding.c +++ b/src/encoding/encoding.c @@ -51,14 +51,6 @@ dummy_read(struct stream_encoded *stream, unsigned char *data, int len) return safe_read(((struct dummy_enc_data *) stream->data)->fd, data, len); } -static unsigned char * -dummy_decode(struct stream_encoded *stream, unsigned char *data, int len, - int *new_len) -{ - *new_len = len; - return data; -} - static unsigned char * dummy_decode_buffer(unsigned char *data, int len, int *new_len) { @@ -77,14 +69,13 @@ dummy_close(struct stream_encoded *stream) mem_free(stream->data); } -static unsigned char *dummy_extensions[] = { NULL }; +static const unsigned char *const dummy_extensions[] = { NULL }; -static struct decoding_backend dummy_decoding_backend = { +static const struct decoding_backend dummy_decoding_backend = { "none", dummy_extensions, dummy_open, dummy_read, - dummy_decode, dummy_decode_buffer, dummy_close, }; @@ -96,7 +87,7 @@ static struct decoding_backend dummy_decoding_backend = { #include "encoding/gzip.h" #include "encoding/lzma.h" -static struct decoding_backend *decoding_backends[] = { +static const struct decoding_backend *const decoding_backends[] = { &dummy_decoding_backend, &gzip_decoding_backend, &bzip2_decoding_backend, @@ -135,16 +126,9 @@ read_encoded(struct stream_encoded *stream, unsigned char *data, int len) return decoding_backends[stream->encoding]->read(stream, data, len); } -/* Decode the given chunk of data in the context of @stream. @data contains the - * original data chunk, @len bytes long. The resulting decoded data chunk is - * *@new_len bytes long. */ -unsigned char * -decode_encoded(struct stream_encoded *stream, unsigned char *data, int len, - int *new_len) -{ - return decoding_backends[stream->encoding]->decode(stream, data, len, new_len); -} - +/* Decode an entire file from a buffer. This function is not suitable + * for parts of files. @data contains the original data, @len bytes + * long. The resulting decoded data chunk is *@new_len bytes long. */ unsigned char * decode_encoded_buffer(enum stream_encoding encoding, unsigned char *data, int len, int *new_len) @@ -163,7 +147,7 @@ close_encoded(struct stream_encoded *stream) /* Return a list of extensions associated with that encoding. */ -unsigned char **listext_encoded(enum stream_encoding encoding) +const unsigned char *const *listext_encoded(enum stream_encoding encoding) { return decoding_backends[encoding]->extensions; } @@ -176,7 +160,7 @@ guess_encoding(unsigned char *filename) int enc; for (enc = 1; enc < ENCODINGS_KNOWN; enc++) { - unsigned char **ext = decoding_backends[enc]->extensions; + const unsigned char *const *ext = decoding_backends[enc]->extensions; while (ext && *ext) { int len = strlen(*ext); @@ -191,7 +175,7 @@ guess_encoding(unsigned char *filename) return ENCODING_NONE; } -unsigned char * +const unsigned char * get_encoding_name(enum stream_encoding encoding) { return decoding_backends[encoding]->name; @@ -210,7 +194,7 @@ try_encoding_extensions(struct string *filename, int *fd) /* No file of that name was found, try some others names. */ for (encoding = 1; encoding < ENCODINGS_KNOWN; encoding++) { - unsigned char **ext = listext_encoded(encoding); + const unsigned char *const *ext = listext_encoded(encoding); for (; ext && *ext; ext++) { add_to_string(filename, *ext); diff --git a/src/encoding/encoding.h b/src/encoding/encoding.h index 703eaf0a..8b32c3b3 100644 --- a/src/encoding/encoding.h +++ b/src/encoding/encoding.h @@ -20,24 +20,22 @@ struct stream_encoded { }; struct decoding_backend { - unsigned char *name; - unsigned char **extensions; + const unsigned char *name; + const unsigned char *const *extensions; int (*open)(struct stream_encoded *stream, int fd); int (*read)(struct stream_encoded *stream, unsigned char *data, int len); - unsigned char *(*decode)(struct stream_encoded *stream, unsigned char *data, int len, int *new_len); unsigned char *(*decode_buffer)(unsigned char *data, int len, int *new_len); void (*close)(struct stream_encoded *stream); }; struct stream_encoded *open_encoded(int, enum stream_encoding); int read_encoded(struct stream_encoded *, unsigned char *, int); -unsigned char *decode_encoded(struct stream_encoded *, unsigned char *, int, int *); unsigned char *decode_encoded_buffer(enum stream_encoding encoding, unsigned char *data, int len, int *new_len); void close_encoded(struct stream_encoded *); -unsigned char **listext_encoded(enum stream_encoding); +const unsigned char *const *listext_encoded(enum stream_encoding); enum stream_encoding guess_encoding(unsigned char *filename); -unsigned char *get_encoding_name(enum stream_encoding encoding); +const unsigned char *get_encoding_name(enum stream_encoding encoding); /* Read from open @stream into the @page string */ enum connection_state diff --git a/src/encoding/gzip.c b/src/encoding/gzip.c index f8632845..a4680007 100644 --- a/src/encoding/gzip.c +++ b/src/encoding/gzip.c @@ -37,14 +37,6 @@ gzip_read(struct stream_encoded *stream, unsigned char *data, int len) return gzread((gzFile *) stream->data, data, len); } -static unsigned char * -gzip_decode(struct stream_encoded *stream, unsigned char *data, int len, - int *new_len) -{ - *new_len = len; - return data; -} - /* The following code for decoding gzip in memory is a mix of code from zlib's * gzio.c file copyrighted 1995-2002 by Jean-loup Gailly and the costumized @@ -237,14 +229,13 @@ gzip_close(struct stream_encoded *stream) gzclose((gzFile *) stream->data); } -static unsigned char *gzip_extensions[] = { ".gz", ".tgz", NULL }; +static const unsigned char *const gzip_extensions[] = { ".gz", ".tgz", NULL }; -struct decoding_backend gzip_decoding_backend = { +const struct decoding_backend gzip_decoding_backend = { "gzip", gzip_extensions, gzip_open, gzip_read, - gzip_decode, gzip_decode_buffer, gzip_close, }; diff --git a/src/encoding/gzip.h b/src/encoding/gzip.h index 7965a4d8..c13038e3 100644 --- a/src/encoding/gzip.h +++ b/src/encoding/gzip.h @@ -4,7 +4,7 @@ #include "encoding/encoding.h" #ifdef CONFIG_GZIP -extern struct decoding_backend gzip_decoding_backend; +extern const struct decoding_backend gzip_decoding_backend; #else #define gzip_decoding_backend dummy_decoding_backend #endif diff --git a/src/encoding/lzma.c b/src/encoding/lzma.c index 9e4bddf2..f4d13459 100644 --- a/src/encoding/lzma.c +++ b/src/encoding/lzma.c @@ -126,14 +126,6 @@ lzma_read(struct stream_encoded *stream, unsigned char *buf, int len) return len; } -static unsigned char * -lzma_decode(struct stream_encoded *stream, unsigned char *data, int len, - int *new_len) -{ - *new_len = len; - return data; -} - static unsigned char * lzma_decode_buffer(unsigned char *data, int len, int *new_len) { @@ -190,14 +182,13 @@ lzma_close(struct stream_encoded *stream) lzma_cleanup(data); } -static unsigned char *lzma_extensions[] = { ".lzma", NULL }; +static const unsigned char *const lzma_extensions[] = { ".lzma", NULL }; -struct decoding_backend lzma_decoding_backend = { +const struct decoding_backend lzma_decoding_backend = { "lzma", lzma_extensions, lzma_open, lzma_read, - lzma_decode, lzma_decode_buffer, lzma_close, }; diff --git a/src/encoding/lzma.h b/src/encoding/lzma.h index 474d3dd3..9268aee1 100644 --- a/src/encoding/lzma.h +++ b/src/encoding/lzma.h @@ -4,7 +4,7 @@ #include "encoding/encoding.h" #ifdef CONFIG_LZMA -extern struct decoding_backend lzma_decoding_backend; +extern const struct decoding_backend lzma_decoding_backend; #else #define lzma_decoding_backend dummy_decoding_backend #endif diff --git a/src/formhist/dialogs.c b/src/formhist/dialogs.c index 9eb5fec5..c4a65dda 100644 --- a/src/formhist/dialogs.c +++ b/src/formhist/dialogs.c @@ -142,7 +142,7 @@ static struct listbox_ops_messages formhist_messages = { N_("Do you really want to remove all forms?"), }; -static struct listbox_ops formhist_listbox_ops = { +static const struct listbox_ops formhist_listbox_ops = { lock_formhist_data, unlock_formhist_data, is_formhist_data_used, @@ -204,7 +204,7 @@ push_save_button(struct dialog_data *dlg_data, struct widget_data *button) return EVENT_PROCESSED; } -static struct hierbox_browser_button formhist_buttons[] = { +static const struct hierbox_browser_button formhist_buttons[] = { /* [gettext_accelerator_context(.formhist_buttons)] */ { N_("~Login"), push_login_button, 1 }, { N_("~Info"), push_hierbox_info_button, 1 }, diff --git a/src/formhist/formhist.c b/src/formhist/formhist.c index c1227f0a..822ce492 100644 --- a/src/formhist/formhist.c +++ b/src/formhist/formhist.c @@ -99,7 +99,8 @@ load_formhist_from_file(void) if (!elinks_home) return 0; - file = straconcat(elinks_home, FORMS_HISTORY_FILENAME, NULL); + file = straconcat(elinks_home, FORMS_HISTORY_FILENAME, + (unsigned char *) NULL); if (!file) return 0; f = fopen(file, "rb"); @@ -222,7 +223,8 @@ save_formhist_to_file(void) if (!elinks_home || get_cmd_opt_bool("anonymous")) return 0; - file = straconcat(elinks_home, FORMS_HISTORY_FILENAME, NULL); + file = straconcat(elinks_home, FORMS_HISTORY_FILENAME, + (unsigned char *) NULL); if (!file) return 0; ssi = secure_open(file); @@ -330,20 +332,31 @@ forget_forms_with_url(unsigned char *url) return count; } -/* Appends form data @form1 (url and submitted_value(s)) to the password file. - * Returns 1 on success, 0 otherwise. */ -static int -remember_form(struct formhist_data *form) +/* Appends form data @form_ (url and submitted_value(s)) to the password file. */ +static void +remember_form(void *form_) { + struct formhist_data *form = form_; + forget_forms_with_url(form->url); add_to_list(saved_forms, form); - return save_formhist_to_file(); + save_formhist_to_file(); } -static int -never_for_this_site(struct formhist_data *form) +static void +dont_remember_form(void *form_) { + struct formhist_data *form = form_; + + done_formhist_item(form); +} + +static void +never_for_this_site(void *form_) +{ + struct formhist_data *form = form_; + form->dontsave = 1; return remember_form(form); } @@ -416,9 +429,9 @@ memorize_form(struct session *ses, struct list_head *submit, "obscured (but unencrypted) in a file on your disk.\n\n" "If you are using a valuable password, answer NO."), form, 3, - N_("~Yes"), remember_form, B_ENTER, - N_("~No"), done_formhist_item, B_ESC, - N_("Ne~ver for this site"), never_for_this_site, NULL); + MSG_BOX_BUTTON(N_("~Yes"), remember_form, B_ENTER), + MSG_BOX_BUTTON(N_("~No"), dont_remember_form, B_ESC), + MSG_BOX_BUTTON(N_("Ne~ver for this site"), never_for_this_site, 0)); return; diff --git a/src/globhist/dialogs.c b/src/globhist/dialogs.c index 9d93f5d5..b8dc26a5 100644 --- a/src/globhist/dialogs.c +++ b/src/globhist/dialogs.c @@ -127,7 +127,7 @@ static struct listbox_ops_messages globhist_messages = { N_("Do you really want to remove all history entries?"), }; -static struct listbox_ops gh_listbox_ops = { +static const struct listbox_ops gh_listbox_ops = { lock_globhist_item, unlock_globhist_item, is_globhist_item_used, @@ -219,7 +219,7 @@ push_bookmark_button(struct dialog_data *dlg_data, /* The global history manager: */ -static struct hierbox_browser_button globhist_buttons[] = { +static const struct hierbox_browser_button globhist_buttons[] = { /* [gettext_accelerator_context(.globhist_buttons)] */ { N_("~Goto"), push_hierbox_goto_button, 1 }, { N_("~Info"), push_hierbox_info_button, 1 }, @@ -232,7 +232,7 @@ static struct hierbox_browser_button globhist_buttons[] = { { N_("C~lear"), push_hierbox_clear_button, 0 }, #if 0 /* TODO: Would this be useful? --jonas */ - { N_("Save"), push_save_button }, + { N_("Save"), push_save_button, 0 }, #endif }; diff --git a/src/globhist/globhist.c b/src/globhist/globhist.c index d7a16200..4eab05b5 100644 --- a/src/globhist/globhist.c +++ b/src/globhist/globhist.c @@ -341,7 +341,8 @@ read_global_history(void) return; if (elinks_home) { - file_name = straconcat(elinks_home, file_name, NULL); + file_name = straconcat(elinks_home, file_name, + (unsigned char *) NULL); if (!file_name) return; } f = fopen(file_name, "rb"); @@ -385,7 +386,8 @@ write_global_history(void) || get_cmd_opt_bool("anonymous")) return; - file_name = straconcat(elinks_home, GLOBAL_HISTORY_FILENAME, NULL); + file_name = straconcat(elinks_home, GLOBAL_HISTORY_FILENAME, + (unsigned char *) NULL); if (!file_name) return; ssi = secure_open(file_name); @@ -393,10 +395,11 @@ write_global_history(void) if (!ssi) return; foreachback (history_item, global_history.entries) { - if (secure_fprintf(ssi, "%s\t%s\t%ld\n", + if (secure_fprintf(ssi, "%s\t%s\t%"TIME_PRINT_FORMAT"\n", history_item->title, history_item->url, - history_item->last_visit) < 0) break; + (time_print_T) history_item->last_visit) < 0) + break; } if (!secure_close(ssi)) global_history.dirty = 0; diff --git a/src/intl/charsets.c b/src/intl/charsets.c index 530778be..719aff33 100644 --- a/src/intl/charsets.c +++ b/src/intl/charsets.c @@ -60,7 +60,7 @@ struct codepage_desc { /* If some byte in the codepage corresponds to multiple Unicode * characters, then the preferred character is in @highhalf - * above, and the rest are listed here in @extra. This table + * above, and the rest are listed here in @table. This table * is not used for translating from the codepage to Unicode. */ const struct table_entry *table; }; @@ -70,7 +70,7 @@ struct codepage_desc { #include "intl/entity.inc" -static char strings[256][2] = { +static const char strings[256][2] = { "\000", "\001", "\002", "\003", "\004", "\005", "\006", "\007", "\010", "\011", "\012", "\013", "\014", "\015", "\016", "\017", "\020", "\021", "\022", "\023", "\024", "\025", "\026", "\033", @@ -117,7 +117,12 @@ free_translation_table(struct conv_table *p) mem_free(p); } -static unsigned char *no_str = "*"; +/* A string used in conversion tables when there is no correct + * conversion. This is compared by address and therefore should be a + * named array rather than a pointer so that it won't share storage + * with any other string literal that happens to have the same + * characters. */ +static const unsigned char no_str[] = "*"; static void new_translation_table(struct conv_table *p) @@ -163,7 +168,7 @@ static const unicode_val_T strange_chars[32] = { #define SYSTEM_CHARSET_FLAG 128 #define is_cp_ptr_utf8(cp_ptr) ((cp_ptr)->aliases == aliases_utf8) -unsigned char * +const unsigned char * u2cp_(unicode_val_T u, int to, enum nbsp_mode nbsp_mode) { int j; @@ -178,7 +183,8 @@ u2cp_(unicode_val_T u, int to, enum nbsp_mode nbsp_mode) return encode_utf8(u); #endif /* CONFIG_UTF8 */ - /* To mark non breaking spaces, we use a special char NBSP_CHAR. */ + /* To mark non breaking spaces in non-UTF-8 strings, we use a + * special char NBSP_CHAR. */ if (u == 0xa0) { if (nbsp_mode == NBSP_MODE_HACK) return NBSP_CHAR_STRING; else /* NBSP_MODE_ASCII */ return " "; @@ -251,7 +257,7 @@ encode_utf8(unicode_val_T u) #ifdef CONFIG_UTF8 /* Number of bytes utf8 character indexed by first byte. Illegal bytes are * equal ones and handled different. */ -static char utf8char_len_tab[256] = { +static const char utf8char_len_tab[256] = { 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, @@ -626,7 +632,7 @@ unicode_fold_label_case(unicode_val_T c) } inline unicode_val_T -utf8_to_unicode(unsigned char **string, unsigned char *end) +utf8_to_unicode(unsigned char **string, const unsigned char *end) { unsigned char *str = *string; unicode_val_T u; @@ -639,40 +645,71 @@ utf8_to_unicode(unsigned char **string, unsigned char *end) } switch (length) { - case 1: + case 1: /* U+0000 to U+007F */ + if (str[0] >= 0x80) { +invalid_utf8: + ++*string; + return UCS_REPLACEMENT_CHARACTER; + } u = str[0]; break; - case 2: + case 2: /* U+0080 to U+07FF */ + if ((str[1] & 0xc0) != 0x80) + goto invalid_utf8; u = (str[0] & 0x1f) << 6; u += (str[1] & 0x3f); + if (u < 0x80) + goto invalid_utf8; break; - case 3: + case 3: /* U+0800 to U+FFFF, except surrogates */ + if ((str[1] & 0xc0) != 0x80 || (str[2] & 0xc0) != 0x80) + goto invalid_utf8; u = (str[0] & 0x0f) << 12; u += ((str[1] & 0x3f) << 6); u += (str[2] & 0x3f); + if (u < 0x800 || is_utf16_surrogate(u)) + goto invalid_utf8; break; - case 4: + case 4: /* U+10000 to U+1FFFFF */ + if ((str[1] & 0xc0) != 0x80 || (str[2] & 0xc0) != 0x80 + || (str[3] & 0xc0) != 0x80) + goto invalid_utf8; u = (str[0] & 0x0f) << 18; u += ((str[1] & 0x3f) << 12); u += ((str[2] & 0x3f) << 6); u += (str[3] & 0x3f); + if (u < 0x10000) + goto invalid_utf8; break; - case 5: + case 5: /* U+200000 to U+3FFFFFF */ + if ((str[1] & 0xc0) != 0x80 || (str[2] & 0xc0) != 0x80 + || (str[3] & 0xc0) != 0x80 || (str[4] & 0xc0) != 0x80) + goto invalid_utf8; u = (str[0] & 0x0f) << 24; u += ((str[1] & 0x3f) << 18); u += ((str[2] & 0x3f) << 12); u += ((str[3] & 0x3f) << 6); u += (str[4] & 0x3f); + if (u < 0x200000) + goto invalid_utf8; break; - case 6: - default: + case 6: /* U+4000000 to U+7FFFFFFF */ + if ((str[1] & 0xc0) != 0x80 || (str[2] & 0xc0) != 0x80 + || (str[3] & 0xc0) != 0x80 || (str[4] & 0xc0) != 0x80 + || (str[5] & 0xc0) != 0x80) + goto invalid_utf8; u = (str[0] & 0x01) << 30; u += ((str[1] & 0x3f) << 24); u += ((str[2] & 0x3f) << 18); u += ((str[3] & 0x3f) << 12); u += ((str[4] & 0x3f) << 6); u += (str[5] & 0x3f); + if (u < 0x4000000) + goto invalid_utf8; break; + default: + INTERNAL("utf8char_len_tab out of range"); + goto invalid_utf8; } *string = str + length; return u; @@ -705,7 +742,7 @@ cp2u(int from, unsigned char c) } /* This slow and ugly code is used by the terminal utf_8_io */ -unsigned char * +const unsigned char * cp2utf8(int from, int c) { from &= ~SYSTEM_CHARSET_FLAG; @@ -736,7 +773,7 @@ cp_to_unicode(int codepage, unsigned char **string, unsigned char *end) static void -add_utf8(struct conv_table *ct, unicode_val_T u, unsigned char *str) +add_utf8(struct conv_table *ct, unicode_val_T u, const unsigned char *str) { unsigned char *p = encode_utf8(u); @@ -765,6 +802,10 @@ add_utf8(struct conv_table *ct, unicode_val_T u, unsigned char *str) ct[*p].u.str = str; } +/* A conversion table from some charset to UTF-8. + * If it is from UTF-8 to UTF-8, it converts each byte separately. + * Unlike in other translation tables, the strings in elements 0x80 to + * 0xFF are allocated dynamically. */ struct conv_table utf_table[256]; int utf_table_init = 1; @@ -773,8 +814,9 @@ free_utf_table(void) { int i; + /* Cast away const. */ for (i = 128; i < 256; i++) - mem_free(utf_table[i].u.str); + mem_free((unsigned char *) utf_table[i].u.str); } static struct conv_table * @@ -787,10 +829,10 @@ get_translation_table_to_utf8(int from) from &= ~SYSTEM_CHARSET_FLAG; if (from == lfr) return utf_table; lfr = from; - if (utf_table_init) - memset(utf_table, 0, sizeof(utf_table)), + if (utf_table_init) { + memset(utf_table, 0, sizeof(utf_table)); utf_table_init = 0; - else + } else free_utf_table(); for (i = 0; i < 128; i++) @@ -826,7 +868,8 @@ get_translation_table_to_utf8(int from) return utf_table; } -struct conv_table table[256]; +/* A conversion table between two charsets, where the target is not UTF-8. */ +static struct conv_table table[256]; static int first = 1; void @@ -886,7 +929,7 @@ get_translation_table(int from, int to) for (i = 128; i < 256; i++) { if (codepages[from].highhalf[i - 0x80] != 0xFFFF) { - unsigned char *u; + const unsigned char *u; u = u2cp(codepages[from].highhalf[i - 0x80], to); if (u) table[i].u.str = u; @@ -922,7 +965,7 @@ struct entity_cache { unsigned int hits; int strlen; int encoding; - unsigned char *result; + const unsigned char *result; unsigned char str[20]; /* Suffice in any case. */ }; @@ -946,7 +989,7 @@ compare_entities(const void *key_, const void *element_) return xxstrcmp(first, second, length); } -unsigned char * +const unsigned char * get_entity_string(const unsigned char *str, const int strlen, int encoding) { #define ENTITY_CACHE_SIZE 10 /* 10 seems a good value. */ @@ -956,7 +999,7 @@ get_entity_string(const unsigned char *str, const int strlen, int encoding) static unsigned int nb_entity_cache[ENTITY_CACHE_MAXLEN]; static int first_time = 1; unsigned int slen = 0; - unsigned char *result = NULL; + const unsigned char *result = NULL; if (strlen <= 0) return NULL; @@ -1150,7 +1193,7 @@ convert_string(struct conv_table *convert_table, /* Iterate ;-) */ while (charspos < charslen) { - unsigned char *translit; + const unsigned char *translit; #define PUTC do { \ buffer[bufferpos++] = chars[charspos++]; \ @@ -1384,6 +1427,11 @@ free_charsets_lookup(void) #endif } +/* Get the codepage's name for displaying to the user, or NULL if + * @cp_index is one past the end. In the future, we might want to + * localize these with gettext. So it may be best not to use this + * function if the name will have to be converted back to an + * index. */ unsigned char * get_cp_name(int cp_index) { @@ -1393,11 +1441,27 @@ get_cp_name(int cp_index) return codepages[cp_index].name; } +/* Get the codepage's name for saving to a configuration file. These + * names can be converted back to indexes, even in future versions of + * ELinks. */ +unsigned char * +get_cp_config_name(int cp_index) +{ + if (cp_index < 0) return "none"; + if (cp_index & SYSTEM_CHARSET_FLAG) return "System"; + if (!codepages[cp_index].aliases) return NULL; + + return codepages[cp_index].aliases[0]; +} + +/* Get the codepage's name for sending to a library or server that + * understands MIME charset names. This function irreversibly maps + * the "System" codepage to the underlying charset. */ unsigned char * get_cp_mime_name(int cp_index) { if (cp_index < 0) return "none"; - if (cp_index & SYSTEM_CHARSET_FLAG) return "System"; + cp_index &= ~SYSTEM_CHARSET_FLAG; if (!codepages[cp_index].aliases) return NULL; return codepages[cp_index].aliases[0]; diff --git a/src/intl/charsets.h b/src/intl/charsets.h index 34c41686..02524547 100644 --- a/src/intl/charsets.h +++ b/src/intl/charsets.h @@ -3,6 +3,13 @@ typedef uint32_t unicode_val_T; +/* U+0020 SPACE. Normally the same as ' ' or L' ' but perhaps ELinks + * shouldn't rely on that. */ +#define UCS_SPACE ((unicode_val_T) 0x0020) + +/* U+00A0 NO-BREAK SPACE. */ +#define UCS_NO_BREAK_SPACE ((unicode_val_T) 0x00A0) + /* U+FFFD REPLACEMENT CHARACTER. Used when no Unicode mapping is * known for a byte in a codepage, or when invalid UTF-8 is received * from a terminal. After generating the character, ELinks then @@ -27,14 +34,29 @@ typedef uint32_t unicode_val_T; * We should fix that if we ever change the value. */ #define UCS_ORPHAN_CELL ((unicode_val_T) 0x20) -/*   replacement character. See u2cp(). */ +/*   replacement character. See u2cp(). + * UTF-8 strings should use the encoding of U+00A0 instead. */ #define NBSP_CHAR ((unsigned char) 1) #define NBSP_CHAR_STRING "\001" +/* How to convert a byte from a source charset. This is used in an + * array (struct conv_table[256]) indexed by the byte value. */ struct conv_table { + /* 0 if this is the final byte of a character, or 1 if more + * bytes are needed. */ int t; union { - unsigned char *str; + /* If @t==0: a null-terminated string that is the + * corresponding character in the target charset. + * Normally, the string is statically allocated. + * However, if the conversion table is to UTF-8, then + * the strings in elements 0x80 to 0xFF are allocated + * with @mem_alloc and owned by the table. */ + const unsigned char *str; + /* If @t==1: a pointer to a nested conversion table + * (with 256 elements) that describes how to convert + * each possible subsequent byte. The conversion + * table owns the nested conversion table. */ struct conv_table *tbl; } u; }; @@ -46,7 +68,8 @@ enum convert_string_mode { CSM_NONE, /* Convert nothing. */ }; -/* How to translate non-breaking spaces. */ +/* How to translate U+00A0 NO-BREAK SPACE. If u2cp_ is converting to + * UTF-8, it ignores this choice and just encodes the U+00A0. */ enum nbsp_mode { /* Convert to NBSP_CHAR. This lets the HTML renderer * recognize nbsp even if the codepage doesn't support @@ -58,7 +81,8 @@ enum nbsp_mode { }; struct conv_table *get_translation_table(int, int); -unsigned char *get_entity_string(const unsigned char *str, const int strlen, int encoding); +const unsigned char *get_entity_string(const unsigned char *str, + const int strlen, int encoding); /* The convert_string() name is also used by Samba (version 3.0.3), which * provides libnss_wins.so.2, which is called somewhere inside @@ -82,6 +106,7 @@ unsigned char *convert_string(struct conv_table *convert_table, int get_cp_index(unsigned char *); unsigned char *get_cp_name(int); +unsigned char *get_cp_config_name(int); unsigned char *get_cp_mime_name(int); int is_cp_utf8(int); void free_conv_table(void); @@ -116,14 +141,14 @@ unsigned char *utf8_step_backward(unsigned char *, unsigned char *, inline int unicode_to_cell(unicode_val_T); unicode_val_T unicode_fold_label_case(unicode_val_T); inline int strlen_utf8(unsigned char **); -inline unicode_val_T utf8_to_unicode(unsigned char **, unsigned char *); +inline unicode_val_T utf8_to_unicode(unsigned char **, const unsigned char *); unicode_val_T cp_to_unicode(int, unsigned char **, unsigned char *); #endif /* CONFIG_UTF8 */ unicode_val_T cp2u(int, unsigned char); -unsigned char *cp2utf8(int, int); +const unsigned char *cp2utf8(int, int); -unsigned char *u2cp_(unicode_val_T, int, enum nbsp_mode); +const unsigned char *u2cp_(unicode_val_T, int, enum nbsp_mode); #define u2cp(u, to) u2cp_(u, to, NBSP_MODE_HACK) #define u2cp_no_nbsp(u, to) u2cp_(u, to, NBSP_MODE_ASCII) diff --git a/src/intl/codepage.inc b/src/intl/codepage.inc index afe53df4..026d6042 100644 --- a/src/intl/codepage.inc +++ b/src/intl/codepage.inc @@ -2134,14 +2134,14 @@ unsigned char *const aliases_8859_16 [] = { const uint16_t highhalf_cp1250 [] = { /* 0x80 */ 0x20AC, /* EURO SIGN */ - /* 0x81 */ 0x0000, /* UNDEFINED */ + /* 0x81 */ 0xFFFF, /* 0x82 */ 0x201A, /* SINGLE LOW-9 QUOTATION MARK */ - /* 0x83 */ 0x0000, /* UNDEFINED */ + /* 0x83 */ 0xFFFF, /* 0x84 */ 0x201E, /* DOUBLE LOW-9 QUOTATION MARK */ /* 0x85 */ 0x2026, /* HORIZONTAL ELLIPSIS */ /* 0x86 */ 0x2020, /* DAGGER */ /* 0x87 */ 0x2021, /* DOUBLE DAGGER */ - /* 0x88 */ 0x0000, /* UNDEFINED */ + /* 0x88 */ 0xFFFF, /* 0x89 */ 0x2030, /* PER MILLE SIGN */ /* 0x8A */ 0x0160, /* LATIN CAPITAL LETTER S WITH CARON */ /* 0x8B */ 0x2039, /* SINGLE LEFT-POINTING ANGLE QUOTATION MARK */ @@ -2149,7 +2149,7 @@ const uint16_t highhalf_cp1250 [] = { /* 0x8D */ 0x0164, /* LATIN CAPITAL LETTER T WITH CARON */ /* 0x8E */ 0x017D, /* LATIN CAPITAL LETTER Z WITH CARON */ /* 0x8F */ 0x0179, /* LATIN CAPITAL LETTER Z WITH ACUTE */ - /* 0x90 */ 0x0000, /* UNDEFINED */ + /* 0x90 */ 0xFFFF, /* 0x91 */ 0x2018, /* LEFT SINGLE QUOTATION MARK */ /* 0x92 */ 0x2019, /* RIGHT SINGLE QUOTATION MARK */ /* 0x93 */ 0x201C, /* LEFT DOUBLE QUOTATION MARK */ @@ -2157,7 +2157,7 @@ const uint16_t highhalf_cp1250 [] = { /* 0x95 */ 0x2022, /* BULLET */ /* 0x96 */ 0x2013, /* EN DASH */ /* 0x97 */ 0x2014, /* EM DASH */ - /* 0x98 */ 0x0000, /* UNDEFINED */ + /* 0x98 */ 0xFFFF, /* 0x99 */ 0x2122, /* TRADE MARK SIGN */ /* 0x9A */ 0x0161, /* LATIN SMALL LETTER S WITH CARON */ /* 0x9B */ 0x203A, /* SINGLE RIGHT-POINTING ANGLE QUOTATION MARK */ @@ -2710,22 +2710,22 @@ unsigned char *const aliases_cp1256 [] = { const uint16_t highhalf_cp1257 [] = { /* 0x80 */ 0x20AC, /* EURO SIGN */ - /* 0x81 */ 0x0000, /* UNDEFINED */ + /* 0x81 */ 0xFFFF, /* 0x82 */ 0x201A, /* SINGLE LOW-9 QUOTATION MARK */ - /* 0x83 */ 0x0000, /* UNDEFINED */ + /* 0x83 */ 0xFFFF, /* 0x84 */ 0x201E, /* DOUBLE LOW-9 QUOTATION MARK */ /* 0x85 */ 0x2026, /* HORIZONTAL ELLIPSIS */ /* 0x86 */ 0x2020, /* DAGGER */ /* 0x87 */ 0x2021, /* DOUBLE DAGGER */ - /* 0x88 */ 0x0000, /* UNDEFINED */ + /* 0x88 */ 0xFFFF, /* 0x89 */ 0x2030, /* PER MILLE SIGN */ - /* 0x8A */ 0x0000, /* UNDEFINED */ + /* 0x8A */ 0xFFFF, /* 0x8B */ 0x2039, /* SINGLE LEFT-POINTING ANGLE QUOTATION MARK */ - /* 0x8C */ 0x0000, /* UNDEFINED */ + /* 0x8C */ 0xFFFF, /* 0x8D */ 0x00A8, /* DIAERESIS */ /* 0x8E */ 0x02C7, /* CARON */ /* 0x8F */ 0x00B8, /* CEDILLA */ - /* 0x90 */ 0x0000, /* UNDEFINED */ + /* 0x90 */ 0xFFFF, /* 0x91 */ 0x2018, /* LEFT SINGLE QUOTATION MARK */ /* 0x92 */ 0x2019, /* RIGHT SINGLE QUOTATION MARK */ /* 0x93 */ 0x201C, /* LEFT DOUBLE QUOTATION MARK */ @@ -2733,20 +2733,20 @@ const uint16_t highhalf_cp1257 [] = { /* 0x95 */ 0x2022, /* BULLET */ /* 0x96 */ 0x2013, /* EN DASH */ /* 0x97 */ 0x2014, /* EM DASH */ - /* 0x98 */ 0x0000, /* UNDEFINED */ + /* 0x98 */ 0xFFFF, /* 0x99 */ 0x2122, /* TRADE MARK SIGN */ - /* 0x9A */ 0x0000, /* UNDEFINED */ + /* 0x9A */ 0xFFFF, /* 0x9B */ 0x203A, /* SINGLE RIGHT-POINTING ANGLE QUOTATION MARK */ - /* 0x9C */ 0x0000, /* UNDEFINED */ + /* 0x9C */ 0xFFFF, /* 0x9D */ 0x00AF, /* MACRON */ /* 0x9E */ 0x02DB, /* OGONEK */ - /* 0x9F */ 0x0000, /* UNDEFINED */ + /* 0x9F */ 0xFFFF, /* 0xA0 */ 0x00A0, /* NO-BREAK SPACE */ - /* 0xA1 */ 0x0000, /* UNDEFINED */ + /* 0xA1 */ 0xFFFF, /* 0xA2 */ 0x00A2, /* CENT SIGN */ /* 0xA3 */ 0x00A3, /* POUND SIGN */ /* 0xA4 */ 0x00A4, /* CURRENCY SIGN */ - /* 0xA5 */ 0x0000, /* UNDEFINED */ + /* 0xA5 */ 0xFFFF, /* 0xA6 */ 0x00A6, /* BROKEN BAR */ /* 0xA7 */ 0x00A7, /* SECTION SIGN */ /* 0xA8 */ 0x00D8, /* LATIN CAPITAL LETTER O WITH STROKE */ diff --git a/src/intl/entity.inc b/src/intl/entity.inc index c17a2a72..f19b047c 100644 --- a/src/intl/entity.inc +++ b/src/intl/entity.inc @@ -1,6 +1,6 @@ /* Automatically generated by gen-ent */ -struct entity { char *s; unicode_val_T c; } entities [1002] = { +static const struct entity { char *s; unicode_val_T c; } entities [1002] = { { "AElig", 0x00C6 }, /* LATIN CAPITAL LETTER AE */ { "Aacgr", 0x0386 }, /* GREEK CAPITAL LETTER ALPHA WITH TONOS */ { "Aacute", 0x00C1 }, /* LATIN CAPITAL LETTER A WITH ACUTE */ diff --git a/src/intl/uni_7b.inc b/src/intl/uni_7b.inc index e8491ed0..44f525b4 100644 --- a/src/intl/uni_7b.inc +++ b/src/intl/uni_7b.inc @@ -1,7 +1,7 @@ /* Automatically generated by gen-7b */ /* DO NOT EDIT THIS FILE! EDIT Unicode/7bitrepl.lnx INSTEAD! */ -struct { unicode_val_T x; unsigned char *s; } unicode_7b [2453] = { +static const struct { unicode_val_T x; unsigned char *s; } unicode_7b [2453] = { {0x00000000, "NUL"}, {0x00000001, "SH"}, {0x00000002, "SX"}, diff --git a/src/main/event.c b/src/main/event.c index 9153ca0e..91e1c0c9 100644 --- a/src/main/event.c +++ b/src/main/event.c @@ -132,7 +132,7 @@ get_event_id(unsigned char *name) if (item) { struct event *event = item->value; - assertm(event, "Hash item with no value"); + assertm(event != NULL, "Hash item with no value"); if_assert_failed return EVENT_NONE; return event->id; diff --git a/src/main/select.c b/src/main/select.c index bcaa190a..cdc68757 100644 --- a/src/main/select.c +++ b/src/main/select.c @@ -251,11 +251,15 @@ select_loop(void (*init)(void)) n = select(w_max, &x_read, &x_write, &x_error, timeout); if (n < 0) { + /* The following calls (especially gettext) + * might change errno. */ + const int errno_from_select = errno; + critical_section = 0; uninstall_alarm(); - if (errno != EINTR) { + if (errno_from_select != EINTR) { ERROR(gettext("The call to %s failed: %d (%s)"), - "select()", errno, (unsigned char *) strerror(errno)); + "select()", errno_from_select, (unsigned char *) strerror(errno_from_select)); if (++select_errors > 10) /* Infinite loop prevention. */ INTERNAL(gettext("%d select() failures."), select_errors); diff --git a/src/main/version.c b/src/main/version.c index 5f425037..c4b33ebf 100644 --- a/src/main/version.c +++ b/src/main/version.c @@ -123,7 +123,7 @@ get_dyn_full_version(struct terminal *term, int more) comma, "UTF-8", #endif comma, - NULL + (unsigned char *) NULL ); add_modules_to_string(&string, term); diff --git a/src/mime/backend/common.c b/src/mime/backend/common.c index 33ae01e7..a103c199 100644 --- a/src/mime/backend/common.c +++ b/src/mime/backend/common.c @@ -24,7 +24,7 @@ #include "mime/backend/mailcap.h" #include "mime/backend/mimetypes.h" -static struct mime_backend *mime_backends[] = { +static const struct mime_backend *const mime_backends[] = { &default_mime_backend, #ifdef CONFIG_MAILCAP &mailcap_mime_backend, @@ -39,7 +39,7 @@ static struct mime_backend *mime_backends[] = { unsigned char * get_content_type_backends(unsigned char *extension) { - struct mime_backend *backend; + const struct mime_backend *backend; int i; foreach_module (backend, mime_backends, i) { @@ -57,7 +57,7 @@ get_content_type_backends(unsigned char *extension) struct mime_handler * get_mime_handler_backends(unsigned char *ctype, int have_x) { - struct mime_backend *backend; + const struct mime_backend *backend; int i; foreach_module (backend, mime_backends, i) { diff --git a/src/mime/backend/default.c b/src/mime/backend/default.c index 3cbc7852..30f27319 100644 --- a/src/mime/backend/default.c +++ b/src/mime/backend/default.c @@ -206,7 +206,7 @@ get_mime_handler_default(unsigned char *type, int have_x) } -struct mime_backend default_mime_backend = { +const struct mime_backend default_mime_backend = { /* get_content_type: */ get_content_type_default, /* get_mime_handler: */ get_mime_handler_default, }; diff --git a/src/mime/backend/default.h b/src/mime/backend/default.h index 041f9799..73453107 100644 --- a/src/mime/backend/default.h +++ b/src/mime/backend/default.h @@ -5,7 +5,7 @@ #include "main/module.h" #include "mime/backend/common.h" -extern struct mime_backend default_mime_backend; +extern const struct mime_backend default_mime_backend; extern struct module default_mime_module; #endif diff --git a/src/mime/backend/mailcap.c b/src/mime/backend/mailcap.c index 772d10a5..aaa17b3f 100644 --- a/src/mime/backend/mailcap.c +++ b/src/mime/backend/mailcap.c @@ -456,7 +456,7 @@ change_hook_mailcap(struct session *ses, struct option *current, struct option * static void init_mailcap(struct module *module) { - struct change_hook_info mimetypes_change_hooks[] = { + static const struct change_hook_info mimetypes_change_hooks[] = { { "mime.mailcap", change_hook_mailcap }, { NULL, NULL }, }; @@ -661,7 +661,7 @@ get_mime_handler_mailcap(unsigned char *type, int options) } -struct mime_backend mailcap_mime_backend = { +const struct mime_backend mailcap_mime_backend = { /* get_content_type: */ NULL, /* get_mime_handler: */ get_mime_handler_mailcap, }; diff --git a/src/mime/backend/mailcap.h b/src/mime/backend/mailcap.h index ce576249..bf81fd37 100644 --- a/src/mime/backend/mailcap.h +++ b/src/mime/backend/mailcap.h @@ -5,7 +5,7 @@ #include "main/module.h" #include "mime/backend/common.h" -extern struct mime_backend mailcap_mime_backend; +extern const struct mime_backend mailcap_mime_backend; extern struct module mailcap_mime_module; #endif diff --git a/src/mime/backend/mimetypes.c b/src/mime/backend/mimetypes.c index d1edcf11..b9e0b59c 100644 --- a/src/mime/backend/mimetypes.c +++ b/src/mime/backend/mimetypes.c @@ -221,7 +221,7 @@ change_hook_mimetypes(struct session *ses, struct option *current, struct option static void init_mimetypes(struct module *module) { - struct change_hook_info mimetypes_change_hooks[] = { + static const struct change_hook_info mimetypes_change_hooks[] = { { "mime.mimetypes", change_hook_mimetypes }, { NULL, NULL }, }; @@ -270,7 +270,7 @@ get_content_type_mimetypes(unsigned char *extension) return NULL; } -struct mime_backend mimetypes_mime_backend = { +const struct mime_backend mimetypes_mime_backend = { /* get_content_type: */ get_content_type_mimetypes, /* get_mime_handler: */ NULL, }; diff --git a/src/mime/backend/mimetypes.h b/src/mime/backend/mimetypes.h index c5b9eebb..f6a188c5 100644 --- a/src/mime/backend/mimetypes.h +++ b/src/mime/backend/mimetypes.h @@ -5,7 +5,7 @@ #include "main/module.h" #include "mime/backend/common.h" -extern struct mime_backend mimetypes_mime_backend; +extern const struct mime_backend mimetypes_mime_backend; extern struct module mimetypes_mime_module; #endif diff --git a/src/mime/dialogs.c b/src/mime/dialogs.c index fc90cc26..1d56e45e 100644 --- a/src/mime/dialogs.c +++ b/src/mime/dialogs.c @@ -62,13 +62,13 @@ menu_del_ext(struct terminal *term, void *fcp, void *xxx2) return; } - msg_box(term, getml(extension, NULL), MSGBOX_FREE_TEXT, + msg_box(term, getml(extension, (void *) NULL), MSGBOX_FREE_TEXT, N_("Delete extension"), ALIGN_CENTER, msg_text(term, N_("Delete extension %s -> %s?"), extension, opt->value.string), extension, 2, - N_("~Yes"), really_del_ext, B_ENTER, - N_("~No"), NULL, B_ESC); + MSG_BOX_BUTTON(N_("~Yes"), really_del_ext, B_ENTER), + MSG_BOX_BUTTON(N_("~No"), NULL, B_ESC)); } @@ -133,7 +133,7 @@ menu_add_ext(struct terminal *term, void *fcp, void *xxx2) add_dlg_end(dlg, MIME_WIDGETS_COUNT); - do_dialog(term, dlg, getml(dlg, NULL)); + do_dialog(term, dlg, getml(dlg, (void *) NULL)); } diff --git a/src/mime/mime.c b/src/mime/mime.c index 5c39b43f..81d64820 100644 --- a/src/mime/mime.c +++ b/src/mime/mime.c @@ -110,7 +110,8 @@ check_extension_type(unsigned char *extension) if (!trimmed) return NULL; - content_type = straconcat("application/x-", trimmed + 1, NULL); + content_type = straconcat("application/x-", trimmed + 1, + (unsigned char *) NULL); if (!content_type) return NULL; @@ -130,7 +131,7 @@ static inline unsigned char * check_encoding_type(unsigned char *extension) { enum stream_encoding encoding = guess_encoding(extension); - unsigned char **extension_list; + const unsigned char *const *extension_list; unsigned char *last_extension = strrchr(extension, '.'); if (encoding == ENCODING_NONE || !last_extension) diff --git a/src/network/connection.c b/src/network/connection.c index 8ab89ac8..1cfc7e95 100644 --- a/src/network/connection.c +++ b/src/network/connection.c @@ -1015,7 +1015,7 @@ cancel_download(struct download *download, int interrupt) if (is_in_result_state(download->state)) return; - assertm(download->conn, "last state is %d", download->state); + assertm(download->conn != NULL, "last state is %d", download->state); check_queue_bugs(); @@ -1074,7 +1074,7 @@ move_download(struct download *old, struct download *new, return; } - assertm(old->conn, "last state is %d", old->state); + assertm(old->conn != NULL, "last state is %d", old->state); conn->pri[new->pri]++; add_to_list(conn->downloads, new); diff --git a/src/network/connection.h b/src/network/connection.h index 67ce5d2e..c9398e50 100644 --- a/src/network/connection.h +++ b/src/network/connection.h @@ -47,7 +47,7 @@ struct connection { struct socket *socket; /* The data socket. It is used, when @socket is used for the control, * and the actual data is transmitted through a different channel. */ - /* The only users now is FTP and SMB. */ + /* The only users now are FTP, FSP, and SMB. */ struct socket *data_socket; int tries; diff --git a/src/network/dns.c b/src/network/dns.c index 0d0622b7..29a3717e 100644 --- a/src/network/dns.c +++ b/src/network/dns.c @@ -196,7 +196,29 @@ do_real_lookup(unsigned char *name, struct sockaddr_storage **addrs, int *addrno #ifdef CONFIG_IPV6 for (i = 0, ai_cur = ai; ai_cur; i++, ai_cur = ai_cur->ai_next) { - struct sockaddr_in6 *addr = (struct sockaddr_in6 *) &(*addrs)[i]; + /* Don't use struct sockaddr_in6 here: because we + * called getaddrinfo with AF_UNSPEC, the address + * might not be for IP at all. */ + struct sockaddr_storage *addr = &(*addrs)[i]; + + /* RFC 3493 says struct sockaddr_storage is supposed + * to be "Large enough to accommodate all supported + * protocol-specific address structures." So if + * getaddrinfo supports an address that does not fit + * in struct sockaddr_storage, then it is a bug in the + * library. In this case, fail the whole lookup, to + * make the bug more likely to be noticed. */ + assert(ai_cur->ai_addrlen <= sizeof(*addr)); + if_assert_failed { + freeaddrinfo(ai); + if (in_thread) + free(*addrs); + else + mem_free(*addrs); + *addrs = NULL; + *addrno = 0; + return DNS_ERROR; + } memcpy(addr, ai_cur->ai_addr, ai_cur->ai_addrlen); } diff --git a/src/network/socket.c b/src/network/socket.c index 732f782e..d39f874c 100644 --- a/src/network/socket.c +++ b/src/network/socket.c @@ -455,7 +455,7 @@ connected(struct socket *socket) int err = 0; socklen_t len = sizeof(err); - assertm(socket->connect_info, "Lost connect_info!"); + assertm(socket->connect_info != NULL, "Lost connect_info!"); if_assert_failed return; if (getsockopt(socket->fd, SOL_SOCKET, SO_ERROR, (void *) &err, &len) == 0) { @@ -672,7 +672,7 @@ write_select(struct socket *socket) struct write_buffer *wb = socket->write_buffer; int wr; - assertm(wb, "write socket has no buffer"); + assertm(wb != NULL, "write socket has no buffer"); if_assert_failed { socket->ops->done(socket, S_INTERNAL); return; @@ -802,7 +802,7 @@ read_select(struct socket *socket) struct read_buffer *rb = socket->read_buffer; ssize_t rd; - assertm(rb, "read socket has no buffer"); + assertm(rb != NULL, "read socket has no buffer"); if_assert_failed { socket->ops->done(socket, S_INTERNAL); return; diff --git a/src/network/state.c b/src/network/state.c index 1d94d32b..5b0f5a21 100644 --- a/src/network/state.c +++ b/src/network/state.c @@ -22,7 +22,8 @@ struct s_msg_dsc { int n; unsigned char *msg; -} msg_dsc[] = { +}; +static const struct s_msg_dsc msg_dsc[] = { {S_WAIT, N_("Waiting in queue")}, {S_DNS, N_("Looking up host")}, {S_CONN, N_("Making connection")}, diff --git a/src/osdep/newwin.c b/src/osdep/newwin.c index 7ffe8453..25e4fe1a 100644 --- a/src/osdep/newwin.c +++ b/src/osdep/newwin.c @@ -86,7 +86,8 @@ open_new_window(struct terminal *term, unsigned char *exe_name, if (twterm) command = twterm; } - command = straconcat(command, " ", exe_name, " ", param, NULL); + command = straconcat(command, " ", exe_name, " ", param, + (unsigned char *) NULL); if (!command) return; exec_on_terminal(term, command, "", 2); diff --git a/src/osdep/os2/os2.c b/src/osdep/os2/os2.c index 922e0c95..8812b4bd 100644 --- a/src/osdep/os2/os2.c +++ b/src/osdep/os2/os2.c @@ -168,7 +168,7 @@ exe(unsigned char *path) if (is_xterm()) flags |= P_BACKGROUND; - pid = spawnlp(flags, shell, shell, "/c", path, NULL); + pid = spawnlp(flags, shell, shell, "/c", path, (char *) NULL); if (pid != -1) waitpid(pid, &ret, 0); diff --git a/src/osdep/osdep.c b/src/osdep/osdep.c index ea36824a..d7705bed 100644 --- a/src/osdep/osdep.c +++ b/src/osdep/osdep.c @@ -349,6 +349,26 @@ static unsigned char *clipboard; unsigned char * get_clipboard_text(void) { + /* The following support for GNU Screen's clipboard is + * disabled for two reasons: + * + * 1. It does not actually return the string from that + * clipboard, but rather causes the clipboard contents to + * appear in stdin. get_clipboard_text is normally called + * because the user pressed a Paste key in an input field, + * so the characters end up being inserted in that field; + * but if there are newlines in the clipboard, then the + * field may lose focus, in which case the remaining + * characters may trigger arbitrary actions in ELinks. + * + * 2. It pastes from both GNU Screen's clipboard and the ELinks + * internal clipboard. Because set_clipboard_text also sets + * them both, the same text would typically get pasted twice. + * + * Users can instead use the GNU Screen key bindings to run the + * paste command. This method still suffers from problem 1 but + * any user of GNU Screen should know that already. */ +#if 0 /* GNU Screen's clipboard */ if (is_gnuscreen()) { struct string str; @@ -359,6 +379,7 @@ get_clipboard_text(void) if (str.length) exe(str.source); if (str.source) done_string(&str); } +#endif return stracpy(empty_string_or_(clipboard)); } diff --git a/src/osdep/signals.c b/src/osdep/signals.c index 72bc31cc..7de1213a 100644 --- a/src/osdep/signals.c +++ b/src/osdep/signals.c @@ -73,7 +73,7 @@ sig_tstp(struct terminal *term) #ifdef SIGSTOP pid_t pid = getpid(); - block_itrm(0); + block_itrm(); #if defined (SIGCONT) && defined(SIGTTOU) if (!fork()) { sleep(1); @@ -95,7 +95,7 @@ sig_tstp(struct terminal *term) static void sig_cont(struct terminal *term) { - if (!unblock_itrm(0)) resize_terminal(); + if (!unblock_itrm()) resize_terminal(); } #endif diff --git a/src/protocol/http/README.timegm b/src/protocol/README.timegm similarity index 100% rename from src/protocol/http/README.timegm rename to src/protocol/README.timegm diff --git a/src/protocol/auth/auth.c b/src/protocol/auth/auth.c index e8d928aa..4f18db5d 100644 --- a/src/protocol/auth/auth.c +++ b/src/protocol/auth/auth.c @@ -329,7 +329,7 @@ get_invalid_auth_entry(void) } struct module auth_module = struct_module( - /* name: */ "Authentication", + /* name: */ N_("Authentication"), /* options: */ NULL, /* hooks: */ NULL, /* submodules: */ NULL, diff --git a/src/protocol/auth/dialogs.c b/src/protocol/auth/dialogs.c index 0722df16..115afabe 100644 --- a/src/protocol/auth/dialogs.c +++ b/src/protocol/auth/dialogs.c @@ -117,7 +117,7 @@ do_auth_dialog(struct session *ses, void *data) add_dlg_end(dlg, AUTH_WIDGETS_COUNT); - dlg_data = do_dialog(term, dlg, getml(dlg, NULL)); + dlg_data = do_dialog(term, dlg, getml(dlg, (void *) NULL)); /* When there's some username, but no password, automagically jump at * the password. */ if (dlg_data && a->user[0] && !a->password[0]) @@ -241,7 +241,7 @@ static struct listbox_ops_messages http_auth_messages = { N_("Do you really want to remove all auth entries?"), }; -static struct listbox_ops auth_listbox_ops = { +static const struct listbox_ops auth_listbox_ops = { lock_auth_entry, unlock_auth_entry, is_auth_entry_used, @@ -256,7 +256,7 @@ static struct listbox_ops auth_listbox_ops = { &http_auth_messages, }; -static struct hierbox_browser_button auth_buttons[] = { +static const struct hierbox_browser_button auth_buttons[] = { /* [gettext_accelerator_context(.auth_buttons)] */ { N_("~Goto"), push_hierbox_goto_button, 1 }, { N_("~Info"), push_hierbox_info_button, 1 }, diff --git a/src/protocol/bittorrent/bencoding.c b/src/protocol/bittorrent/bencoding.c index 6a7d0aae..237f3af7 100644 --- a/src/protocol/bittorrent/bencoding.c +++ b/src/protocol/bittorrent/bencoding.c @@ -760,6 +760,7 @@ parse_bittorrent_metafile(struct bittorrent_meta *meta, struct string *metafile) break; case BENCODING_TOKEN_CREATION_DATE: + /* Bug 923: Assumes time_t values fit in off_t. */ meta->creation_date = (time_t) parse_bencoding_integer(value); skip_scanner_token(&scanner); break; diff --git a/src/protocol/bittorrent/dialogs.c b/src/protocol/bittorrent/dialogs.c index 5b88b83c..5001c5e0 100644 --- a/src/protocol/bittorrent/dialogs.c +++ b/src/protocol/bittorrent/dialogs.c @@ -814,7 +814,7 @@ bittorrent_query_callback(void *data, enum connection_state state, add_dlg_end(dlg, widgets); - ml = getml(dlg, NULL); + ml = getml(dlg, (void *) NULL); if (!ml) { /* XXX: Assume that the allocated @external_handler will be * freed when releasing the @type_query. */ diff --git a/src/protocol/bittorrent/piececache.c b/src/protocol/bittorrent/piececache.c index b6ef4a6e..80b54d99 100644 --- a/src/protocol/bittorrent/piececache.c +++ b/src/protocol/bittorrent/piececache.c @@ -379,7 +379,7 @@ add_piece_to_bittorrent_free_list(struct bittorrent_piece_cache *cache, return NULL; } - assertm(piece_offset == piece_length); + assert(piece_offset == piece_length); assertm(blocks, "Piece was not divided into blocks"); assert(!cache->entries[piece].blocks); @@ -1221,7 +1221,7 @@ update_bittorrent_piece_cache_state(struct bittorrent_connection *bittorrent) foreachsafe (entry, next, cache->queue) { uint32_t piece_length, piece; - assertm(entry->data && entry->completed); + assert(entry->data && entry->completed); piece = entry - cache->entries; diff --git a/src/protocol/common.c b/src/protocol/common.c index 099b0adf..41807e13 100644 --- a/src/protocol/common.c +++ b/src/protocol/common.c @@ -47,12 +47,14 @@ enum connection_state init_directory_listing(struct string *page, struct uri *uri) { struct string dirpath = NULL_STRING; + struct string decoded = NULL_STRING; struct string location = NULL_STRING; unsigned char *info; int local = (uri->protocol == PROTOCOL_FILE); if (!init_string(page) || !init_string(&dirpath) + || !init_string(&decoded) || !init_string(&location) || !add_uri_to_string(&dirpath, uri, URI_DATA) || !add_uri_to_string(&location, uri, URI_DIR_LOCATION)) @@ -63,11 +65,10 @@ init_directory_listing(struct string *page, struct uri *uri) && !add_char_to_string(&dirpath, local ? CHAR_DIR_SEP : '/')) goto out_of_memory; - if (local || uri->protocol == PROTOCOL_GOPHER) { - /* A little hack to get readable Gopher names. We should find a - * way to do it more general. */ - decode_uri_string(&dirpath); - } + /* Decode uri for displaying. */ + if (!add_string_to_string(&decoded, &dirpath)) + goto out_of_memory; + decode_uri_string(&decoded); if (!local && !add_char_to_string(&location, '/')) goto out_of_memory; @@ -75,23 +76,15 @@ init_directory_listing(struct string *page, struct uri *uri) if (!add_to_string(page, "\n")) goto out_of_memory; - if (!local && !add_string_to_string(page, &location)) + if (!local && !add_html_to_string(page, location.source, location.length)) goto out_of_memory; - if (!add_html_to_string(page, dirpath.source, dirpath.length) + if (!add_html_to_string(page, decoded.source, decoded.length) || !add_to_string(page, "\n\n\n\n

")) goto out_of_memory; @@ -109,6 +102,9 @@ init_directory_listing(struct string *page, struct uri *uri) case PROTOCOL_GOPHER: info = "Gopher"; break; + case PROTOCOL_SMB: + info = "Samba"; + break; default: info = "?"; } @@ -122,20 +118,24 @@ init_directory_listing(struct string *page, struct uri *uri) /* Make the directory path with links to each subdir. */ { - unsigned char *slash = dirpath.source; - unsigned char *pslash = slash; - unsigned char sep = local ? CHAR_DIR_SEP : '/'; + const unsigned char *slash = dirpath.source; + const unsigned char *pslash = slash; + const unsigned char sep = local ? CHAR_DIR_SEP : '/'; + + while ((slash = strchr(slash, sep)) != NULL) { + done_string(&decoded); + if (!init_string(&decoded) + || !add_bytes_to_string(&decoded, pslash, slash - pslash)) + goto out_of_memory; + decode_uri_string(&decoded); - while ((slash = strchr(slash, sep))) { - /* FIXME: htmlesc? At least we should escape quotes. --pasky */ if (!add_to_string(page, "") - || !add_html_to_string(page, pslash, slash - pslash) + || !add_html_to_string(page, decoded.source, decoded.length) || !add_to_string(page, "") - || !add_char_to_string(page, sep)) + || !add_html_to_string(page, &sep, 1)) goto out_of_memory; pslash = ++slash; @@ -148,6 +148,7 @@ out_of_memory: } done_string(&dirpath); + done_string(&decoded); done_string(&location); return page->length > 0 ? S_OK : S_OUT_OF_MEM; diff --git a/src/protocol/data.c b/src/protocol/data.c index ad3ad223..c783239e 100644 --- a/src/protocol/data.c +++ b/src/protocol/data.c @@ -73,7 +73,8 @@ init_data_protocol_header(struct cache_entry *cached, if (!type) return NULL; /* Set fake content type */ - head = straconcat("\r\nContent-Type: ", type, "\r\n", NULL); + head = straconcat("\r\nContent-Type: ", type, "\r\n", + (unsigned char *) NULL); mem_free(type); if (!head) return NULL; diff --git a/src/protocol/date.c b/src/protocol/date.c index 37b0db0e..bdd72477 100644 --- a/src/protocol/date.c +++ b/src/protocol/date.c @@ -218,6 +218,8 @@ my_timegm(struct tm *tm) tm->tm_mon *= 153; tm->tm_mon += 2; tm->tm_year -= 68; + /* Bug 924: Assumes all years divisible by 4 are leap years, + * even though e.g. 2100 is not. */ tm->tm_mday += tm->tm_year * 1461 / 4; tm->tm_mday += ((tm->tm_mon / 5) - 672); diff --git a/src/protocol/file/cgi.c b/src/protocol/file/cgi.c index 81b22a11..75830fb7 100644 --- a/src/protocol/file/cgi.c +++ b/src/protocol/file/cgi.c @@ -120,8 +120,14 @@ send_post_data(struct connection *conn) add_bytes_to_string(&data, buffer, n); - write_to_socket(conn->data_socket, data.source, data.length, - S_SENT, close_pipe_and_read); + /* If we're submitting a form whose controls do not have + * names, then the POST has a Content-Type but empty data, + * and an assertion would fail in write_to_socket. */ + if (data.length) + write_to_socket(conn->data_socket, data.source, data.length, + S_SENT, close_pipe_and_read); + else + close_pipe_and_read(conn->data_socket); done_string(&data); #undef POST_BUFFER_SIZE @@ -368,23 +374,27 @@ execute_cgi(struct connection *conn) close_all_non_term_fd(); last_slash[-1] = 0; set_cwd(script); last_slash[-1] = '/'; - if (execl(script, script, NULL)) { + if (execl(script, script, (char *) NULL)) { _exit(3); } } else { /* ELinks */ - - if (!init_http_connection_info(conn, 1, 0, 1)) - return 0; - mem_free(script); + if (!init_http_connection_info(conn, 1, 0, 1)) { + close(pipe_read[0]); close(pipe_read[1]); + close(pipe_write[0]); close(pipe_write[1]); + return 0; + } + close(pipe_read[1]); close(pipe_write[0]); conn->socket->fd = pipe_read[0]; /* Use data socket for passing the pipe. It will be cleaned up in * close_pipe_and_read(). */ - conn->data_socket->fd = pipe_read[1]; + conn->data_socket->fd = pipe_write[1]; + set_nonblocking_fd(conn->socket->fd); + set_nonblocking_fd(conn->data_socket->fd); send_request(conn); return 0; diff --git a/src/protocol/file/file.c b/src/protocol/file/file.c index 80f16380..44c995ac 100644 --- a/src/protocol/file/file.c +++ b/src/protocol/file/file.c @@ -77,7 +77,7 @@ struct module file_protocol_module = struct_module( /* Directory listing */ /* Based on the @entry attributes and file-/dir-/linkname is added to the @data - * fragment. */ + * fragment. All the strings are in the system charset. */ static inline void add_dir_entry(struct directory_entry *entry, struct string *page, int pathlen, unsigned char *dircolor) @@ -112,7 +112,7 @@ add_dir_entry(struct directory_entry *entry, struct string *page, if (readlen > 0 && readlen != MAX_STR_LEN) { buf[readlen] = '\0'; - lnk = straconcat(" -> ", buf, NULL); + lnk = straconcat(" -> ", buf, (unsigned char *) NULL); } if (!stat(entry->name, &st) && S_ISDIR(st.st_mode)) @@ -124,7 +124,8 @@ add_dir_entry(struct directory_entry *entry, struct string *page, if (entry->attrib[0] == 'd' && *dircolor) { /* The is for the case when use_document_colors is off. */ - string_concat(page, "", NULL); + string_concat(page, "", + (unsigned char *) NULL); } add_string_to_string(page, &html_encoded_name); @@ -241,7 +242,7 @@ file_protocol_handler(struct connection *connection) unsigned char *redirect_location = NULL; struct string page, name; enum connection_state state; - unsigned char *type = NULL; + int set_dir_content_type = 0; if (get_cmd_opt_bool("anonymous")) { if (strcmp(connection->uri->string, "file:///dev/stdin") @@ -279,7 +280,7 @@ file_protocol_handler(struct connection *connection) state = S_OK; } else { state = list_directory(connection, name.source, &page); - type = "text/html"; + set_dir_content_type = 1; } } else { @@ -322,17 +323,24 @@ file_protocol_handler(struct connection *connection) add_fragment(cached, 0, page.source, page.length); connection->from += page.length; - if (!cached->content_type) { - unsigned char *ctype = null_or_stracpy(type); + if (!cached->head && set_dir_content_type) { + unsigned char *head; + + /* If the system charset somehow + * changes after the directory listing + * has been generated, it should be + * parsed with the original charset. */ + head = straconcat("\r\nContent-Type: text/html; charset=", + get_cp_mime_name(get_cp_index("System")), + "\r\n", (unsigned char *) NULL); /* Not so gracefully handle failed memory * allocation. */ - if (type && !ctype) + if (!head) state = S_OUT_OF_MEM; - /* Setup file read or directory listing for - * viewing. */ - mem_free_set(&cached->content_type, ctype); + /* Setup directory listing for viewing. */ + mem_free_set(&cached->head, head); } done_string(&page); diff --git a/src/protocol/fsp/fsp.c b/src/protocol/fsp/fsp.c index c66848a4..04bd3df1 100644 --- a/src/protocol/fsp/fsp.c +++ b/src/protocol/fsp/fsp.c @@ -30,6 +30,7 @@ #include "network/connection.h" #include "network/socket.h" #include "osdep/osdep.h" +#include "protocol/auth/auth.h" #include "protocol/common.h" #include "protocol/protocol.h" #include "protocol/fsp/fsp.h" @@ -63,22 +64,63 @@ struct module fsp_protocol_module = struct_module( ); -/* FSP synchronous connection management: */ +/* Because functions of fsplib block waiting for a response from the + * server, and ELinks wants non-blocking operations so that other + * connections and the user interface keep working, this FSP protocol + * module forks a child process for each FSP connection. The child + * process writes the results to two pipes, which the main ELinks + * process then reads in a non-blocking fashion. The child process + * gets these pipes as its stdout and stderr. + * + * - If an error occurs, the child process writes "text/x-error" + * without newline to stderr, and an error code and a newline to + * stdout. The error code is either from errno or a negated value + * from enum connection_state, e.g. -S_OUT_OF_MEM. In particular, + * EPERM causes the parent process to prompt for username and + * password. (In this, fsplib differs from libsmbclient, which uses + * EACCES if authentication fails.) + * + * - If the resource is a regular file, the child process writes the + * estimated length of the file (in bytes) and a newline to stderr, + * and the contents of the file to stdout. + * + * - If the resource is a directory, the child process writes + * "text/html" without newline to stderr, and an HTML rendering + * of the directory listing to stdout. + * + * The exit code of the child process also indicates whether an error + * occurred, but the parent process ignores it. */ + +/* FSP synchronous connection management (child process): + * + * The child process generally does not bother to free the memory it + * allocates. When the process exits, the operating system will free + * the memory anyway. There is no point in changing this, because the + * child process also inherits memory allocations from the parent + * process, and it would be very cumbersome to free those. */ /* FIXME: Although it is probably not so much an issue, check if writes to * stdout fails for directory listing like we do for file fetching. */ static void -fsp_error(unsigned char *error) +fsp_error(int error) { - fprintf(stderr, "text/plain"); - puts(error); + printf("%d\n", error); + fprintf(stderr, "text/x-error"); + /* In principle, this should perhaps call fsp_close_session to + * make the server accept any key from the next client process + * at this IP address. That doesn't seem necessary though: + * fsplib uses various IPC schemes to synchronize the use of + * server-provided keys between client processes, so the next + * client process will probably be able to use the key saved + * by this one. */ exit(1); } static int -compare(FSP_RDENTRY *a, FSP_RDENTRY *b) +compare(const void *av, const void *bv) { + const FSP_RDENTRY *a = av, *b = bv; int res = ((b->type == FSP_RDTYPE_DIR) - (a->type == FSP_RDTYPE_DIR)); if (res) @@ -87,24 +129,47 @@ compare(FSP_RDENTRY *a, FSP_RDENTRY *b) } static void -display_entry(FSP_RDENTRY *fentry, unsigned char dircolor[]) +display_entry(const FSP_RDENTRY *fentry, const unsigned char dircolor[]) { - printf("%10d\tsize, fentry->name); + struct string string; + + /* fentry->name is a fixed-size array and is followed by other + * members; thus, if the name reported by the server does not + * fit in the array, fsplib must either truncate or reject it. + * If fsplib truncates the name, it does not document whether + * fentry->namlen is the original length or the truncated + * length. ELinks therefore ignores fentry->namlen and + * instead measures the length on its own. */ + const size_t namelen = strlen(fentry->name); + + if (!init_string(&string)) return; + add_format_to_string(&string, "%10d", fentry->size); + add_to_string(&string, "\tname, namelen, 0); if (fentry->type == FSP_RDTYPE_DIR) { - printf("/\">"); - if (*dircolor) - printf("", dircolor); - printf("%s", fentry->name); - if (*dircolor) - printf(""); + add_to_string(&string, "/\">"); + if (*dircolor) { + add_to_string(&string, ""); + } + add_html_to_string(&string, fentry->name, namelen); + if (*dircolor) { + add_to_string(&string, ""); + } } else { - printf("\">%s", fentry->name); + add_to_string(&string, "\">"); + add_html_to_string(&string, fentry->name, namelen); } - puts(""); + add_to_string(&string, ""); + puts(string.source); + done_string(&string); } static void -sort_and_display_entries(FSP_DIR *dir, unsigned char dircolor[]) +sort_and_display_entries(FSP_DIR *dir, const unsigned char dircolor[]) { FSP_RDENTRY fentry, *fresult, *table = NULL; int size = 0; @@ -120,11 +185,13 @@ sort_and_display_entries(FSP_DIR *dir, unsigned char dircolor[]) if (!new_table) continue; table = new_table; - memcpy(&table[size], &fentry, sizeof(fentry)); + copy_struct(&table[size], &fentry); size++; } - qsort(table, size, sizeof(*table), - (int (*)(const void *, const void *)) compare); + /* If size==0, then table==NULL. According to ISO/IEC 9899:1999 + * 7.20.5p1, the NULL must not be given to qsort. */ + if (size > 0) + qsort(table, size, sizeof(*table), compare); for (i = 0; i < size; i++) { display_entry(&table[i], dircolor); @@ -139,20 +206,23 @@ fsp_directory(FSP_SESSION *ses, struct uri *uri) unsigned char *data = get_uri_string(uri, URI_DATA); unsigned char dircolor[8] = ""; - if (!data || init_directory_listing(&buf, uri) != S_OK) - fsp_error("Out of memory"); + if (!data) + fsp_error(-S_OUT_OF_MEM); + decode_uri(data); + if (init_directory_listing(&buf, uri) != S_OK) + fsp_error(-S_OUT_OF_MEM); + + dir = fsp_opendir(ses, data); + if (!dir) fsp_error(errno); fprintf(stderr, "text/html"); fclose(stderr); puts(buf.source); - dir = fsp_opendir(ses, data); - if (!dir) goto end; - if (get_opt_bool("document.browse.links.color_dirs")) { color_to_string(get_opt_color("document.colors.dirs"), - (unsigned char *) &dircolor); + dircolor); } if (get_opt_bool("protocol.fsp.sort")) { @@ -164,9 +234,8 @@ fsp_directory(FSP_SESSION *ses, struct uri *uri) if (!fresult) break; display_entry(&fentry, dircolor); } - fsp_closedir(dir); } -end: + fsp_closedir(dir); puts("
"); fsp_close_session(ses); exit(0); @@ -177,32 +246,75 @@ end: static void do_fsp(struct connection *conn) { + FSP_SESSION *ses; struct stat sb; struct uri *uri = conn->uri; + struct auth_entry *auth; unsigned char *host = get_uri_string(uri, URI_HOST); - unsigned char *password = get_uri_string(uri, URI_PASSWORD); unsigned char *data = get_uri_string(uri, URI_DATA); unsigned short port = (unsigned short)get_uri_port(uri); - FSP_SESSION *ses = fsp_open_session(host, port, password); + unsigned char *password = NULL; - if (!ses) - fsp_error("Session initialization failed."); - if (fsp_stat(ses, data, &sb)) - fsp_error("File not found."); - if (S_ISDIR(sb.st_mode)) + decode_uri(data); + if (uri->passwordlen) { + password = get_uri_string(uri, URI_PASSWORD); + } else { + auth = find_auth(uri); + if (auth) password = auth->password; + } + + ses = fsp_open_session(host, port, password); + if (!ses) fsp_error(errno); + + /* fsplib 0.8 ABI depends on _FILE_OFFSET_BITS + * https://sourceforge.net/tracker/index.php?func=detail&aid=1674729&group_id=93841&atid=605738 + * If ELinks and fsplib are using different values of + * _FILE_OFFSET_BITS, then they get different definitions of + * struct stat, and the st_size stored by fsp_stat is + * typically not the same as the st_size read by ELinks. + * Fortunately, st_mode seems to have the same offset and size + * in both versions of struct stat. + * + * If all the bytes used by the 32-bit st_size are also used + * by the 64-bit st_size, then ELinks may be able to guess + * which ones they are, because the current version 2 of FSP + * supports only 32-bit file sizes in protocol packets. Begin + * by filling struct stat with 0xAA so that it's easier to + * detect which bytes fsp_stat has left unchanged. (Only + * sb.st_size really needs to be filled, but filling the rest + * too helps viewing the data with a debugger.) */ + memset(&sb, 0xAA, sizeof(sb)); + if (fsp_stat(ses, data, &sb)) fsp_error(errno); + + if (S_ISDIR(sb.st_mode)) { fsp_directory(ses, uri); - else { /* regular file */ + } else { /* regular file */ char buf[READ_SIZE]; FSP_FILE *file = fsp_fopen(ses, data, "r"); int r; - if (!file) - fsp_error("fsp_fopen error."); + if (!file) { + fsp_error(errno); + } - /* Use the default way to find the MIME type, so write an - * 'empty' name, since something needs to be written in order - * to avoid socket errors. */ - fprintf(stderr, "%c", '\0'); +#if SIZEOF_OFF_T >= 8 + if (sb.st_size < 0 || sb.st_size > 0xFFFFFFFF) { + /* Probably a _FILE_OFFSET_BITS mismatch as + * described above. Try to detect which half + * of st_size is the real size. This may + * depend on the endianness of the processor + * and on the padding in struct stat. */ + if ((sb.st_size & 0xFFFFFFFF00000000ULL) == 0xAAAAAAAA00000000ULL) + sb.st_size = sb.st_size & 0xFFFFFFFF; + else if ((sb.st_size & 0xFFFFFFFF) == 0xAAAAAAAA) + sb.st_size = (sb.st_size >> 32) & 0xFFFFFFFF; + else /* Can't figure it out. */ + sb.st_size = 1; + } +#endif + + /* Send filesize */ + fprintf(stderr, "%" OFF_T_FORMAT "\n", (off_t)(sb.st_size)); fclose(stderr); while ((r = fsp_fread(buf, 1, READ_SIZE, file)) > 0) @@ -218,7 +330,51 @@ do_fsp(struct connection *conn) #undef READ_SIZE -/* FSP asynchronous connection management: */ + +/* FSP asynchronous connection management (parent process): */ + +/* Kill the current connection and ask for a username/password for the next + * try. */ +static void +prompt_username_pw(struct connection *conn) +{ + add_auth_entry(conn->uri, "FSP", NULL, NULL, 0); + abort_connection(conn, S_OK); +} + +static void +fsp_got_error(struct socket *socket, struct read_buffer *rb) +{ + int len = rb->length; + struct connection *conn = socket->conn; + int error; + + if (len < 0) { + abort_connection(conn, -errno); + return; + } + + /* There should be free space in the buffer, because + * @alloc_read_buffer allocated several kibibytes, and the + * child process wrote only an integer and a newline to the + * pipe. */ + assert(rb->freespace >= 1); + if_assert_failed { + abort_connection(conn, S_INTERNAL); + return; + } + rb->data[len] = '\0'; + error = atoi(rb->data); + kill_buffer_data(rb, len); + switch (error) { + case EPERM: + prompt_username_pw(conn); + break; + default: + abort_connection(conn, -error); + break; + } +} static void fsp_got_data(struct socket *socket, struct read_buffer *rb) @@ -251,11 +407,17 @@ fsp_got_header(struct socket *socket, struct read_buffer *rb) { struct connection *conn = socket->conn; struct read_buffer *buf; + int error = 0; conn->cached = get_cache_entry(conn->uri); if (!conn->cached) { - close(socket->fd); - close(conn->data_socket->fd); + /* Even though these are pipes rather than real + * sockets, call close_socket instead of close, to + * ensure that abort_connection won't try to close the + * file descriptors again. (Could we skip the calls + * and assume abort_connection will do them?) */ + close_socket(socket); + close_socket(conn->data_socket); abort_connection(conn, S_OUT_OF_MEM); return; } @@ -264,20 +426,46 @@ fsp_got_header(struct socket *socket, struct read_buffer *rb) if (rb->length > 0) { unsigned char *ctype = memacpy(rb->data, rb->length); - if (ctype && *ctype) - mem_free_set(&conn->cached->content_type, ctype); - else + if (ctype && *ctype) { + if (!strcmp(ctype, "text/x-error")) { + error = 1; + mem_free(ctype); + } else { + if (ctype[0] >= '0' && ctype[0] <= '9') { +#ifdef HAVE_ATOLL + conn->est_length = (off_t)atoll(ctype); +#else + conn->est_length = (off_t)atol(ctype); +#endif + mem_free(ctype); + + /* avoid read from socket error */ + if (!conn->est_length) { + abort_connection(conn, S_OK); + return; + } + } + else mem_free_set(&conn->cached->content_type, ctype); + } + } else { mem_free_if(ctype); + } } buf = alloc_read_buffer(conn->data_socket); if (!buf) { - close(socket->fd); - close(conn->data_socket->fd); + close_socket(socket); + close_socket(conn->data_socket); abort_connection(conn, S_OUT_OF_MEM); return; } - read_from_socket(conn->data_socket, buf, S_CONN, fsp_got_data); + + if (error) { + mem_free_set(&conn->cached->content_type, stracpy("text/html")); + read_from_socket(conn->data_socket, buf, S_CONN, fsp_got_error); + } else { + read_from_socket(conn->data_socket, buf, S_CONN, fsp_got_data); + } } @@ -300,6 +488,7 @@ fsp_protocol_handler(struct connection *conn) } conn->from = 0; conn->unrestartable = 1; + find_auth(conn->uri); /* remember username and password */ cpid = fork(); if (cpid == -1) { @@ -314,15 +503,23 @@ fsp_protocol_handler(struct connection *conn) } if (!cpid) { - close(1); dup2(fsp_pipe[1], 1); - close(0); dup2(open("/dev/null", O_RDONLY), 0); - close(2); dup2(header_pipe[1], 2); close(fsp_pipe[0]); close(header_pipe[0]); + /* There may be outgoing data in stdio buffers + * inherited from the parent process. The parent + * process is going to write this data, so the child + * process must not do that. Closing the file + * descriptors ensures this. + * + * FIXME: If something opens more files and gets the + * same file descriptors and does not close them + * before exit(), then stdio may attempt to write the + * buffers to the wrong files. This might happen for + * example if fsplib calls syslog(). */ close_all_non_term_fd(); do_fsp(conn); @@ -331,12 +528,14 @@ fsp_protocol_handler(struct connection *conn) conn->data_socket->fd = fsp_pipe[0]; conn->socket->fd = header_pipe[0]; + set_nonblocking_fd(conn->data_socket->fd); + set_nonblocking_fd(conn->socket->fd); close(fsp_pipe[1]); close(header_pipe[1]); buf2 = alloc_read_buffer(conn->socket); if (!buf2) { - close(fsp_pipe[0]); - close(header_pipe[0]); + close_socket(conn->data_socket); + close_socket(conn->socket); abort_connection(conn, S_OUT_OF_MEM); return; } diff --git a/src/protocol/ftp/ftp.c b/src/protocol/ftp/ftp.c index 01e301bc..11587ee3 100644 --- a/src/protocol/ftp/ftp.c +++ b/src/protocol/ftp/ftp.c @@ -638,6 +638,26 @@ get_ftp_data_socket(struct connection *conn, struct string *command) return 1; } +/* Check if the file or directory name @s can be safely sent to the + * FTP server. To prevent command injection attacks, this function + * must reject CR LF sequences. */ +static int +is_ftp_pathname_safe(const struct string *s) +{ + int i; + + /* RFC 959 says the argument of CWD and RETR is a , + * which consists of s, "any of the 128 ASCII characters + * except and ". So other control characters, such + * as 0x00 and 0x7F, are allowed here. Bytes 0x80...0xFF + * should not be allowed, but if we reject them, users will + * probably complain. */ + for (i = 0; i < s->length; i++) { + if (s->source[i] == 0x0A || s->source[i] == 0x0D) + return 0; + } + return 1; +} /* Create passive socket and add appropriate announcing commands to str. Then * go and retrieve appropriate object from server. @@ -645,40 +665,53 @@ get_ftp_data_socket(struct connection *conn, struct string *command) static struct ftp_connection_info * add_file_cmd_to_str(struct connection *conn) { - struct ftp_connection_info *ftp; - struct string command, ftp_data_command; + int ok = 0; + struct ftp_connection_info *ftp = NULL; + struct string command = NULL_STRING; + struct string ftp_data_command = NULL_STRING; + struct string pathname = NULL_STRING; if (!conn->uri->data) { INTERNAL("conn->uri->data empty"); abort_connection(conn, S_INTERNAL); - return NULL; + goto ret; } + /* This will be reallocated below when we know how long the + * command string should be. Error handling could be + * simplified a little by allocating this initial structure on + * the stack, but it's several kilobytes long so that might be + * risky. */ ftp = mem_calloc(1, sizeof(*ftp)); if (!ftp) { abort_connection(conn, S_OUT_OF_MEM); - return NULL; + goto ret; } conn->info = ftp; /* Freed when connection is destroyed. */ - if (!init_string(&command)) { + if (!init_string(&command) + || !init_string(&ftp_data_command) + || !init_string(&pathname)) { abort_connection(conn, S_OUT_OF_MEM); - return NULL; - } - - if (!init_string(&ftp_data_command)) { - done_string(&command); - abort_connection(conn, S_OUT_OF_MEM); - return NULL; + goto ret; } if (!get_ftp_data_socket(conn, &ftp_data_command)) { - done_string(&command); - done_string(&ftp_data_command); INTERNAL("Ftp data socket failure"); abort_connection(conn, S_INTERNAL); - return NULL; + goto ret; + } + + if (!add_uri_to_string(&pathname, conn->uri, URI_PATH)) { + abort_connection(conn, S_OUT_OF_MEM); + goto ret; + } + + decode_uri_string(&pathname); + if (!is_ftp_pathname_safe(&pathname)) { + abort_connection(conn, S_BAD_URL); + goto ret; } if (!conn->uri->datalen @@ -688,18 +721,20 @@ add_file_cmd_to_str(struct connection *conn) ftp->dir = 1; ftp->pending_commands = 4; - /* ASCII */ - add_to_string(&command, "TYPE A"); - add_crlf_to_string(&command); + if (!add_to_string(&command, "TYPE A") /* ASCII */ + || !add_crlf_to_string(&command) - add_string_to_string(&command, &ftp_data_command); + || !add_string_to_string(&command, &ftp_data_command) + + || !add_to_string(&command, "CWD ") + || !add_string_to_string(&command, &pathname) + || !add_crlf_to_string(&command) - add_to_string(&command, "CWD "); - add_uri_to_string(&command, conn->uri, URI_PATH); - add_crlf_to_string(&command); - - add_to_string(&command, "LIST"); - add_crlf_to_string(&command); + || !add_to_string(&command, "LIST") + || !add_crlf_to_string(&command)) { + abort_connection(conn, S_OUT_OF_MEM); + goto ret; + } conn->from = 0; @@ -709,45 +744,58 @@ add_file_cmd_to_str(struct connection *conn) ftp->dir = 0; ftp->pending_commands = 3; - /* BINARY */ - add_to_string(&command, "TYPE I"); - add_crlf_to_string(&command); + if (!add_to_string(&command, "TYPE I") /* BINARY */ + || !add_crlf_to_string(&command) - add_string_to_string(&command, &ftp_data_command); + || !add_string_to_string(&command, &ftp_data_command)) { + abort_connection(conn, S_OUT_OF_MEM); + goto ret; + } if (conn->from || conn->progress->start > 0) { - add_to_string(&command, "REST "); - add_long_to_string(&command, conn->from - ? conn->from - : conn->progress->start); - add_crlf_to_string(&command); + const off_t offset = conn->from + ? conn->from + : conn->progress->start; + + if (!add_to_string(&command, "REST ") + || !add_long_to_string(&command, offset) + || !add_crlf_to_string(&command)) { + abort_connection(conn, S_OUT_OF_MEM); + goto ret; + } ftp->rest_sent = 1; ftp->pending_commands++; } - add_to_string(&command, "RETR "); - add_uri_to_string(&command, conn->uri, URI_PATH); - add_crlf_to_string(&command); + if (!add_to_string(&command, "RETR ") + || !add_string_to_string(&command, &pathname) + || !add_crlf_to_string(&command)) { + abort_connection(conn, S_OUT_OF_MEM); + goto ret; + } } - done_string(&ftp_data_command); - ftp->opc = ftp->pending_commands; /* 1 byte is already reserved for cmd_buffer in struct ftp_connection_info. */ ftp = mem_realloc(ftp, sizeof(*ftp) + command.length); if (!ftp) { - done_string(&command); abort_connection(conn, S_OUT_OF_MEM); - return NULL; + goto ret; } + conn->info = ftp; /* in case mem_realloc moved the buffer */ memcpy(ftp->cmd_buffer, command.source, command.length + 1); - done_string(&command); - conn->info = ftp; + ok = 1; - return ftp; +ret: + /* If @ok is false here, then abort_connection has already + * freed @ftp, which now is a dangling pointer. */ + done_string(&pathname); + done_string(&ftp_data_command); + done_string(&command); + return ok ? ftp : NULL; } static void @@ -858,12 +906,21 @@ next: return file_len; } +/* Connect to the host and port specified by a passive FTP server. */ static int ftp_data_connect(struct connection *conn, int pf, struct sockaddr_storage *sa, int size_of_sockaddr) { - int fd = socket(pf, SOCK_STREAM, 0); + int fd; + if (conn->data_socket->fd != -1) { + /* The server maliciously sent multiple 227 or 229 + * responses. Do not leak the previous data_socket. */ + abort_connection(conn, S_FTP_ERROR); + return -1; + } + + fd = socket(pf, SOCK_STREAM, 0); if (fd < 0 || set_nonblocking_fd(fd) < 0) { abort_connection(conn, S_FTP_ERROR); return -1; @@ -988,6 +1045,21 @@ ftp_retr_file(struct socket *socket, struct read_buffer *rb) } } + if (conn->data_socket->fd == -1) { + /* The passive FTP server did not send a 227 or 229 + * response. We check this down here, rather than + * immediately after getting the response to the PASV + * or EPSV command, to make sure that nothing can + * close the socket between the check and the + * following set_handlers call. + * + * If we were using active FTP, then + * get_ftp_data_socket would have created the + * data_socket without waiting for anything from the + * server. */ + abort_connection(conn, S_FTP_ERROR); + return; + } set_handlers(conn->data_socket->fd, (select_handler_T) ftp_data_accept, NULL, NULL, conn); @@ -1047,10 +1119,17 @@ ftp_got_final_response(struct socket *socket, struct read_buffer *rb) } +/* How to format an FTP directory listing in HTML. */ +struct ftp_dir_html_format { + int libc_codepage; + int colorize_dir; + unsigned char dircolor[8]; +}; + /* Display directory entry formatted in HTML. */ static int display_dir_entry(struct cache_entry *cached, off_t *pos, int *tries, - int colorize_dir, unsigned char *dircolor, + const struct ftp_dir_html_format *format, struct ftp_file_info *ftp_info) { struct string string; @@ -1102,7 +1181,10 @@ display_dir_entry(struct cache_entry *cached, off_t *pos, int *tries, time_t when = ftp_info->mtime; struct tm *when_tm; unsigned char *fmt; - unsigned char date[13]; + /* LC_TIME=fi_FI.UTF_8 can generate "elo___ 31 23:59" + * where each _ denotes U+00A0 encoded as 0xC2 0xA0, + * thus needing a 19-byte buffer. */ + unsigned char date[80]; int wr; if (ftp_info->local_time_zone) @@ -1117,31 +1199,41 @@ display_dir_entry(struct cache_entry *cached, off_t *pos, int *tries, fmt = "%b %e %H:%M"; wr = strftime(date, sizeof(date), fmt, when_tm); - - while (wr < sizeof(date) - 1) date[wr++] = ' '; - date[sizeof(date) - 1] = '\0'; - add_to_string(&string, date); + add_cp_html_to_string(&string, format->libc_codepage, + date, wr); } else #endif add_to_string(&string, " "); + /* TODO: Above, the number of spaces might not match the width + * of the string generated by strftime. It depends on the + * locale. So if ELinks knows the timestamps of some FTP + * files but not others, it may misalign the file names. + * Potential solutions: + * - Pad the strings to a compile-time fixed width. + * Con: If we choose a width that suffices for all known + * locales, then it will be stupidly large for most of them. + * - Generate an HTML table. + * Con: Bloats the HTML source. + * Any solution chosen here should also be applied to the + * file: protocol handler. */ add_char_to_string(&string, ' '); - if (ftp_info->type == FTP_FILE_DIRECTORY && colorize_dir) { + if (ftp_info->type == FTP_FILE_DIRECTORY && format->colorize_dir) { add_to_string(&string, "dircolor); add_to_string(&string, "\">"); } add_to_string(&string, "name.source, ftp_info->name.length); + encode_uri_string(&string, ftp_info->name.source, ftp_info->name.length, 0); if (ftp_info->type == FTP_FILE_DIRECTORY) add_char_to_string(&string, '/'); add_to_string(&string, "\">"); add_html_to_string(&string, ftp_info->name.source, ftp_info->name.length); add_to_string(&string, ""); - if (ftp_info->type == FTP_FILE_DIRECTORY && colorize_dir) { + if (ftp_info->type == FTP_FILE_DIRECTORY && format->colorize_dir) { add_to_string(&string, ""); } @@ -1195,7 +1287,7 @@ ftp_get_line(struct cache_entry *cached, unsigned char *buf, int bufl, static int ftp_process_dirlist(struct cache_entry *cached, off_t *pos, unsigned char *buffer, int buflen, int last, - int *tries, int colorize_dir, unsigned char *dircolor) + int *tries, const struct ftp_dir_html_format *format) { int ret = 0; @@ -1222,8 +1314,8 @@ ftp_process_dirlist(struct cache_entry *cached, off_t *pos, && ftp_info.name.source[1] == '.'))) continue; - retv = display_dir_entry(cached, pos, tries, colorize_dir, - dircolor, &ftp_info); + retv = display_dir_entry(cached, pos, tries, + format, &ftp_info); if (retv < 0) { return ret; } @@ -1234,12 +1326,26 @@ ftp_process_dirlist(struct cache_entry *cached, off_t *pos, } } +/* This is the initial read handler for conn->data_socket->fd, + * which may be either trying to connect to a passive FTP server or + * listening for a connection from an active FTP server. In active + * FTP, this function then accepts the connection and replaces + * conn->data_socket->fd with the resulting socket. In any case, + * this function does not read any data from the FTP server, but + * rather hands the socket over to got_something_from_data_connection, + * which then does the reads. */ static void ftp_data_accept(struct connection *conn) { struct ftp_connection_info *ftp = conn->info; int newsock; + /* Because this function is called only as a read handler of + * conn->data_socket->fd, the socket must be valid if we get + * here. */ + assert(conn->data_socket->fd >= 0); + if_assert_failed return; + set_connection_timeout(conn); clear_handlers(conn->data_socket->fd); @@ -1265,14 +1371,22 @@ ftp_data_accept(struct connection *conn) NULL, NULL, conn); } +/* A read handler for conn->data_socket->fd. This function reads + * data from the FTP server, reformats it to HTML if it's a directory + * listing, and adds the result to the cache entry. */ static void got_something_from_data_connection(struct connection *conn) { struct ftp_connection_info *ftp = conn->info; - unsigned char dircolor[8]; - int colorize_dir = 0; + struct ftp_dir_html_format format; ssize_t len; + /* Because this function is called only as a read handler of + * conn->data_socket->fd, the socket must be valid if we get + * here. */ + assert(conn->data_socket->fd >= 0); + if_assert_failed return; + /* XXX: This probably belongs rather to connect.c ? */ set_connection_timeout(conn); @@ -1285,11 +1399,13 @@ out_of_mem: } if (ftp->dir) { - colorize_dir = get_opt_bool("document.browse.links.color_dirs"); + format.libc_codepage = get_cp_index("System"); - if (colorize_dir) { + format.colorize_dir = get_opt_bool("document.browse.links.color_dirs"); + + if (format.colorize_dir) { color_to_string(get_opt_color("document.colors.dirs"), - (unsigned char *) &dircolor); + format.dircolor); } } @@ -1317,7 +1433,7 @@ out_of_mem: struct ftp_file_info ftp_info = INIT_FTP_FILE_INFO_ROOT; display_dir_entry(conn->cached, &conn->from, &conn->tries, - colorize_dir, dircolor, &ftp_info); + &format, &ftp_info); } mem_free_set(&conn->cached->content_type, stracpy("text/html")); @@ -1347,8 +1463,7 @@ out_of_mem: ftp->ftp_buffer, len + ftp->buf_pos, 0, &conn->tries, - colorize_dir, - (unsigned char *) dircolor); + &format); if (proceeded == -1) goto out_of_mem; @@ -1365,8 +1480,7 @@ out_of_mem: if (ftp_process_dirlist(conn->cached, &conn->from, ftp->ftp_buffer, ftp->buf_pos, 1, - &conn->tries, colorize_dir, - (unsigned char *) dircolor) == -1) + &conn->tries, &format) == -1) goto out_of_mem; #define ADD_CONST(str) { \ diff --git a/src/protocol/ftp/parse.c b/src/protocol/ftp/parse.c index be4326e7..59b24e42 100644 --- a/src/protocol/ftp/parse.c +++ b/src/protocol/ftp/parse.c @@ -109,6 +109,7 @@ parse_ftp_eplf_response(struct ftp_file_info *info, unsigned char *src, int len) case FTP_EPLF_MTIME: if (src >= pos) break; + /* Bug 923: Assumes time_t values cannot exceed LONG_MAX. */ info->mtime = (time_t) parse_ftp_number(&src, pos, 0, LONG_MAX); break; case FTP_EPLF_ID: diff --git a/src/protocol/http/codes.c b/src/protocol/http/codes.c index bdc59dd4..e0740eae 100644 --- a/src/protocol/http/codes.c +++ b/src/protocol/http/codes.c @@ -25,11 +25,11 @@ struct http_code { int num; - unsigned char *str; + const unsigned char *str; }; /* Source: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html */ -static struct http_code http_code[] = { +static const struct http_code http_code[] = { { 100, "Continue" }, { 101, "Switching Protocols" }, { 200, "OK" }, @@ -77,18 +77,19 @@ static int compare_http_codes(const void *key, const void *element) { int first = (long) key; - int second = ((struct http_code *) element)->num; + int second = ((const struct http_code *) element)->num; return first - second; } -static unsigned char * +static const unsigned char * http_code_to_string(int code) { - struct http_code *element = bsearch((void *) (long) code, http_code, - sizeof_array(http_code), - sizeof(*element), - compare_http_codes); + const struct http_code *element + = bsearch((void *) (long) code, http_code, + sizeof_array(http_code), + sizeof(*element), + compare_http_codes); if (element) return element->str; @@ -100,7 +101,7 @@ http_code_to_string(int code) static unsigned char * get_http_error_document(struct terminal *term, struct uri *uri, int code) { - unsigned char *codestr = http_code_to_string(code); + const unsigned char *codestr = http_code_to_string(code); unsigned char *title = asprintfa(_("HTTP error %03d", term), code); struct string string; @@ -126,7 +127,7 @@ get_http_error_document(struct terminal *term, struct uri *uri, int code) add_format_to_string(&string, _( " An error occurred on the server while fetching the document you\n" " requested. However, the server did not send back any explanation of what\n" - " happenned, so it is unknown what went wrong. Please contact the web\n" + " happened, so it is unknown what went wrong. Please contact the web\n" " server administrator about this, if you believe that this error should\n" " not occur since it is not a nice behaviour from the web server at all\n" " and indicates that there is some much deeper problem with the web server\n" @@ -168,8 +169,21 @@ show_http_error_document(struct session *ses, void *data) if (cache) str = get_http_error_document(term, info->uri, info->code); if (str) { + /* The codepage that _("foo", term) used when it was + * called by get_http_error_document. */ + const int gettext_codepage + = get_opt_codepage_tree(term->spec, "charset"); + if (cached) delete_entry_content(cache); + + /* If we run out of memory here, it's perhaps better + * to display a malformatted error message than none + * at all. */ mem_free_set(&cache->content_type, stracpy("text/html")); + mem_free_set(&cache->head, + straconcat("\r\nContent-Type: text/html; charset=", + get_cp_mime_name(gettext_codepage), + "\r\n", (unsigned char *) NULL)); add_fragment(cache, 0, str, strlen(str)); mem_free(str); diff --git a/src/protocol/http/http.c b/src/protocol/http/http.c index 00c7bfbe..62f7c3f7 100644 --- a/src/protocol/http/http.c +++ b/src/protocol/http/http.c @@ -440,8 +440,9 @@ static int check_http_server_bugs(struct uri *uri, struct http_connection_info *http, unsigned char *head) { - unsigned char *server, **s; - static unsigned char *buggy_servers[] = { + unsigned char *server; + const unsigned char *const *s; + static const unsigned char *const buggy_servers[] = { "mod_czech/3.1.0", "Purveyor", "Netscape-Enterprise", @@ -580,6 +581,11 @@ http_send_header(struct socket *socket) add_to_string(&header, "TRACE "); } else if (use_connect) { add_to_string(&header, "CONNECT "); + /* In CONNECT requests, we send only a subset of the + * headers to the proxy. See the "CONNECT:" comments + * below. After the CONNECT request succeeds, we + * negotiate TLS with the real server and make a new + * HTTP request that includes all the headers. */ } else if (uri->post) { add_to_string(&header, "POST "); conn->unrestartable = 1; @@ -612,10 +618,14 @@ http_send_header(struct socket *socket) add_long_to_string(&header, http->sent_version.minor); add_crlf_to_string(&header); + /* CONNECT: Sending a Host header seems pointless as the same + * information is already in the CONNECT line. It's harmless + * though and Mozilla does it too. */ add_to_string(&header, "Host: "); add_uri_to_string(&header, uri, URI_HTTP_HOST); add_crlf_to_string(&header); + /* CONNECT: Proxy-Authorization is intended to be seen by the proxy. */ if (talking_to_proxy) { unsigned char *user = get_opt_str("protocol.http.proxy.user"); unsigned char *passwd = get_opt_str("protocol.http.proxy.passwd"); @@ -647,7 +657,7 @@ http_send_header(struct socket *socket) if (user[0]) { unsigned char *proxy_data; - proxy_data = straconcat(user, ":", passwd, NULL); + proxy_data = straconcat(user, ":", passwd, (unsigned char *) NULL); if (proxy_data) { unsigned char *proxy_64 = base64_encode(proxy_data); @@ -663,6 +673,9 @@ http_send_header(struct socket *socket) } } + /* CONNECT: User-Agent does not reveal anything about the + * resource we're fetching, and it may help the proxy return + * better error messages. */ optstr = get_opt_str("protocol.http.user_agent"); if (*optstr && strcmp(optstr, " ")) { unsigned char *ustr, ts[64] = ""; @@ -688,33 +701,47 @@ http_send_header(struct socket *socket) add_crlf_to_string(&header); } - switch (get_opt_int("protocol.http.referer.policy")) { - case REFERER_NONE: - /* oh well */ - break; + /* CONNECT: Referer probably is a secret page in the HTTPS + * server, so don't reveal it to the proxy. */ + if (!use_connect) { + switch (get_opt_int("protocol.http.referer.policy")) { + case REFERER_NONE: + /* oh well */ + break; - case REFERER_FAKE: - optstr = get_opt_str("protocol.http.referer.fake"); - if (!optstr[0]) break; - add_to_string(&header, "Referer: "); - add_to_string(&header, optstr); - add_crlf_to_string(&header); - break; + case REFERER_FAKE: + optstr = get_opt_str("protocol.http.referer.fake"); + if (!optstr[0]) break; + add_to_string(&header, "Referer: "); + add_to_string(&header, optstr); + add_crlf_to_string(&header); + break; - case REFERER_TRUE: - if (!conn->referrer) break; - add_to_string(&header, "Referer: "); - add_url_to_http_string(&header, conn->referrer, URI_HTTP_REFERRER); - add_crlf_to_string(&header); - break; + case REFERER_TRUE: + if (!conn->referrer) break; + add_to_string(&header, "Referer: "); + add_url_to_http_string(&header, conn->referrer, URI_HTTP_REFERRER); + add_crlf_to_string(&header); + break; - case REFERER_SAME_URL: - add_to_string(&header, "Referer: "); - add_url_to_http_string(&header, uri, URI_HTTP_REFERRER); - add_crlf_to_string(&header); - break; + case REFERER_SAME_URL: + add_to_string(&header, "Referer: "); + add_url_to_http_string(&header, uri, URI_HTTP_REFERRER); + add_crlf_to_string(&header); + break; + } } + /* CONNECT: Do send all Accept* headers to the CONNECT proxy, + * because they do not reveal anything about the resource + * we're going to request via TLS, and they may affect the + * error message if the CONNECT request fails. + * + * If ELinks is ever changed to vary its Accept headers based + * on what it intends to do with the returned resource, e.g. + * sending "Accept: text/css" when it wants an external + * stylesheet, then it should do that only in the inner GET + * and not in the outer CONNECT. */ add_to_string(&header, "Accept: */*"); add_crlf_to_string(&header); @@ -722,18 +749,14 @@ http_send_header(struct socket *socket) #if defined(CONFIG_GZIP) || defined(CONFIG_BZIP2) add_to_string(&header, "Accept-Encoding: "); -#ifdef BUG_517 #ifdef CONFIG_BZIP2 add_to_string(&header, "bzip2"); #endif -#endif #ifdef CONFIG_GZIP -#ifdef BUG_517 #ifdef CONFIG_BZIP2 add_to_string(&header, ", "); -#endif #endif add_to_string(&header, "gzip"); @@ -769,6 +792,11 @@ http_send_header(struct socket *socket) } #endif + /* CONNECT: Proxy-Connection is intended to be seen by the + * proxy. If the CONNECT request succeeds, then the proxy + * will forward the remainder of the TCP connection to the + * origin server, and Proxy-Connection does not matter; but + * if the request fails, then Proxy-Connection may matter. */ /* FIXME: What about post-HTTP/1.1?? --Zas */ if (HTTP_1_1(http->sent_version)) { if (!IS_PROXY_URI(conn->uri)) { @@ -785,7 +813,9 @@ http_send_header(struct socket *socket) add_crlf_to_string(&header); } - if (conn->cached) { + /* CONNECT: Do not tell the proxy anything we have cached + * about the resource. */ + if (!use_connect && conn->cached) { if (!conn->cached->incomplete && conn->cached->head && conn->cache_mode <= CACHE_MODE_CHECK_IF_MODIFIED) { if (conn->cached->last_modified) { @@ -801,6 +831,8 @@ http_send_header(struct socket *socket) } } + /* CONNECT: Let's send cache control headers to the proxy too; + * they may affect DNS caching. */ if (conn->cache_mode >= CACHE_MODE_FORCE_RELOAD) { add_to_string(&header, "Pragma: no-cache"); add_crlf_to_string(&header); @@ -808,7 +840,9 @@ http_send_header(struct socket *socket) add_crlf_to_string(&header); } - if (conn->from || conn->progress->start > 0) { + /* CONNECT: Do not reveal byte ranges to the proxy. It can't + * do anything good with that information anyway. */ + if (!use_connect && (conn->from || conn->progress->start > 0)) { /* conn->from takes precedence. conn->progress.start is set only the first * time, then conn->from gets updated and in case of any retries * etc we have everything interesting in conn->from already. */ @@ -818,10 +852,13 @@ http_send_header(struct socket *socket) add_crlf_to_string(&header); } + /* CONNECT: The Authorization header is for the origin server only. */ + if (!use_connect) { #ifdef CONFIG_GSSAPI - if (http_negotiate_output(uri, &header) != 0) + if (http_negotiate_output(uri, &header) != 0) #endif - entry = find_auth(uri); + entry = find_auth(uri); + } if (entry) { if (entry->digest) { @@ -846,7 +883,8 @@ http_send_header(struct socket *socket) unsigned char *id; /* Create base64 encoded string. */ - id = straconcat(entry->user, ":", entry->password, NULL); + id = straconcat(entry->user, ":", entry->password, + (unsigned char *) NULL); if (id) { unsigned char *base64 = base64_encode(id); @@ -862,7 +900,8 @@ http_send_header(struct socket *socket) } } - if (uri->post) { + /* CONNECT: Any POST data is for the origin server only. */ + if (!use_connect && uri->post) { /* We search for first '\n' in uri->post to get content type * as set by get_form_uri(). This '\n' is dropped if any * and replaced by correct '\r\n' termination here. */ @@ -881,7 +920,8 @@ http_send_header(struct socket *socket) } #ifdef CONFIG_COOKIES - { + /* CONNECT: Cookies are for the origin server only. */ + if (!use_connect) { struct string *cookies = send_cookies(uri); if (cookies) { @@ -895,12 +935,17 @@ http_send_header(struct socket *socket) add_crlf_to_string(&header); + /* CONNECT: Any POST data is for the origin server only. + * This was already checked above and post_data is NULL + * in that case. Verified with an assertion below. */ if (post_data) { #define POST_BUFFER_SIZE 4096 unsigned char *post = post_data; unsigned char buffer[POST_BUFFER_SIZE]; int n = 0; + assert(!use_connect); /* see comment above */ + while (post[0] && post[1]) { int h1, h2; @@ -1027,30 +1072,17 @@ decompress_data(struct connection *conn, unsigned char *data, int len, } } - if (state == FINISHING) { - /* state is FINISHING. Set to_read to some nice, big - * value to empty the encoded output queue by reading - * big chunks from it. */ - to_read = BIG_READ; - } - if (!conn->stream) { conn->stream = open_encoded(conn->stream_pipes[0], conn->content_encoding); if (!conn->stream) return NULL; - /* On "startup" pipe is treated with care, but if everything - * was already written to the pipe, caution isn't necessary */ - if (state != FINISHING) { - /* on init don't read too much */ - to_read = PIPE_BUF / 32; - } } - output = (unsigned char *) mem_realloc(output, *new_len + to_read); + output = (unsigned char *) mem_realloc(output, *new_len + BIG_READ); if (!output) break; - did_read = read_encoded(conn->stream, output + *new_len, - to_read); + did_read = read_encoded(conn->stream, output + *new_len, BIG_READ); + if (did_read > 0) *new_len += did_read; else if (did_read == -1) { mem_free_set(&output, NULL); @@ -1832,13 +1864,13 @@ again: && (!strcasecmp(d, "gzip") || !strcasecmp(d, "x-gzip"))) conn->content_encoding = ENCODING_GZIP; #endif -#ifdef BUG_517 + #ifdef CONFIG_BZIP2 if (file_encoding != ENCODING_BZIP2 && (!strcasecmp(d, "bzip2") || !strcasecmp(d, "x-bzip2"))) conn->content_encoding = ENCODING_BZIP2; #endif -#endif + mem_free(d); } diff --git a/src/protocol/protocol.c b/src/protocol/protocol.c index 3ffca54c..d7d2e71a 100644 --- a/src/protocol/protocol.c +++ b/src/protocol/protocol.c @@ -233,7 +233,7 @@ generic_external_protocol_handler(struct session *ses, struct uri *uri) "%s protocol support"), protocol_backends[uri->protocol].name), ses, 1, - N_("~OK"), NULL, B_ENTER | B_ESC); + MSG_BOX_BUTTON(N_("~OK"), NULL, B_ENTER | B_ESC)); return; } diff --git a/src/protocol/proxy.c b/src/protocol/proxy.c index f52cf2b0..ca6fdcdb 100644 --- a/src/protocol/proxy.c +++ b/src/protocol/proxy.c @@ -60,7 +60,8 @@ proxy_uri(struct uri *uri, unsigned char *proxy, struct string string; if (init_string(&string) - && string_concat(&string, "proxy://", proxy, "/", NULL) + && string_concat(&string, "proxy://", proxy, "/", + (unsigned char *) NULL) && add_uri_to_string(&string, uri, URI_BASE)) { /* There is no need to use URI_BASE when calling get_uri() * because URI_BASE should not add any fragments in the first diff --git a/src/protocol/rewrite/rewrite.c b/src/protocol/rewrite/rewrite.c index c3886c1c..f66d4e54 100644 --- a/src/protocol/rewrite/rewrite.c +++ b/src/protocol/rewrite/rewrite.c @@ -92,11 +92,16 @@ static struct option_info uri_rewrite_options[] = { INIT_OPT_STRING("protocol.rewrite", N_("Default template"), "default_template", 0, "", + /* xgettext:no-c-format */ N_("Default URI template used when the string entered in\n" "the goto dialog does not appear to be a URI or a filename\n" "(i.e. contains no '.', ':' or '/' characters), and does\n" "not match any defined prefixes. Set the value to \"\" to\n" - "disable use of the default template rewrite rule.")), + "disable use of the default template rewrite rule.\n" + "%c in the template means the current URL\n" + "%s in the template means the whole string from the goto dialog\n" + "%0,%1,...,%9 mean the 1st,2nd,...,10th space-delimited part of %s\n" + "%% in the template means '%'")), #define INIT_OPT_DUMB_PREFIX(prefix, uri) \ INIT_OPT_STRING("protocol.rewrite.dumb", NULL, prefix, 0, uri, NULL) diff --git a/src/protocol/smb/Makefile b/src/protocol/smb/Makefile index ef1f8b6f..9d49ef33 100644 --- a/src/protocol/smb/Makefile +++ b/src/protocol/smb/Makefile @@ -1,6 +1,6 @@ top_builddir=../../.. include $(top_builddir)/Makefile.config -OBJS = smb.o +OBJS = smb2.o include $(top_srcdir)/Makefile.lib diff --git a/src/protocol/smb/smb.c b/src/protocol/smb/smb.c deleted file mode 100644 index e183baed..00000000 --- a/src/protocol/smb/smb.c +++ /dev/null @@ -1,721 +0,0 @@ -/* Internal SMB protocol implementation */ - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE /* Needed for asprintf() */ -#endif - -#error SMB protocol support is vulnerable to CVE-2006-5925. Do not use. -#error If you want to use SMB, please vote for bug 844 or post a patch. - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include -#include -#ifdef HAVE_FCNTL_H -#include /* OS/2 needs this after sys/types.h */ -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "elinks.h" - -#include "cache/cache.h" -#include "config/options.h" -#include "intl/gettext/libintl.h" -#include "main/module.h" -#include "main/select.h" -#include "network/connection.h" -#include "network/socket.h" -#include "osdep/osdep.h" -#include "protocol/common.h" -#include "protocol/protocol.h" -#include "protocol/smb/smb.h" -#include "protocol/uri.h" -#include "util/memory.h" -#include "util/snprintf.h" -#include "util/string.h" - -/* XXX: Nice cleanup target --pasky */ -/* FIXME: we rely on smbclient output which may change in future, - * so i think we should use libsmbclient instead (or better in addition) - * This stuff is a quick hack, but it works ;). --Zas */ - -enum smb_list_type { - SMB_LIST_NONE, - SMB_LIST_SHARES, - SMB_LIST_DIR, -}; - -struct smb_connection_info { - enum smb_list_type list_type; - - /* If this is 1, it means one socket is already off. The second one - * should call end_smb_connection() when it goes off as well. */ - int closing; - - size_t textlen; - unsigned char text[1]; -}; - -static void end_smb_connection(struct connection *conn); - - -struct option_info smb_options[] = { - INIT_OPT_TREE("protocol", N_("SMB"), - "smb", 0, - N_("SAMBA specific options.")), - - INIT_OPT_STRING("protocol.smb", N_("Credentials"), - "credentials", 0, "", - N_("Credentials file passed to smbclient via -A option.")), - - NULL_OPTION_INFO, -}; - -struct module smb_protocol_module = struct_module( - /* name: */ N_("SMB"), - /* options: */ smb_options, - /* hooks: */ NULL, - /* submodules: */ NULL, - /* data: */ NULL, - /* init: */ NULL, - /* done: */ NULL -); - - -/* Return 0 if @conn->cached was set. */ -static int -smb_get_cache(struct connection *conn) -{ - if (conn->cached) return 0; - - conn->cached = get_cache_entry(conn->uri); - if (conn->cached) return 0; - - abort_connection(conn, S_OUT_OF_MEM); - return -1; -} - - -#define READ_SIZE 4096 - -static ssize_t -smb_read_data(struct connection *conn, int sock, unsigned char *dst) -{ - ssize_t r; - struct smb_connection_info *si = conn->info; - - r = read(sock, dst, READ_SIZE); - if (r == -1) { - retry_connection(conn, -errno); - return -1; - } - if (r == 0) { - if (!si->closing) { - si->closing = 1; - clear_handlers(sock); - return 0; - } - end_smb_connection(conn); - return 0; - } - - return r; -} - -static void -smb_read_text(struct connection *conn, int sock) -{ - ssize_t r; - struct smb_connection_info *si = conn->info; - - /* We add 2 here to handle LF and NUL chars that are added in - * smb_end_connection(). */ - si = mem_realloc(si, sizeof(*si) + si->textlen - + READ_SIZE + 2); - if (!si) { - abort_connection(conn, S_OUT_OF_MEM); - return; - } - conn->info = si; - - r = smb_read_data(conn, sock, si->text + si->textlen); - if (r <= 0) return; - - if (!conn->from) set_connection_state(conn, S_GETH); - si->textlen += r; -} - -static void -smb_got_data(struct connection *conn) -{ - struct smb_connection_info *si = conn->info; - unsigned char buffer[READ_SIZE]; - ssize_t r; - - if (si->list_type != SMB_LIST_NONE) { - smb_read_text(conn, conn->data_socket->fd); - return; - } - - r = smb_read_data(conn, conn->data_socket->fd, buffer); - if (r <= 0) return; - - set_connection_state(conn, S_TRANS); - - if (smb_get_cache(conn)) return; - - conn->received += r; - if (add_fragment(conn->cached, conn->from, buffer, r) == 1) - conn->tries = 0; - conn->from += r; -} - -#undef READ_SIZE - -static void -smb_got_text(struct connection *conn) -{ - smb_read_text(conn, conn->socket->fd); -} - - /* Search for @str1 followed by @str2 in @line. - * It returns NULL if not found, or pointer to start - * of @str2 in @line if found. */ -static unsigned char * -find_strs(unsigned char *line, unsigned char *str1, - unsigned char *str2) -{ - unsigned char *p = strstr(line, str1); - - if (!p) return NULL; - - p = strstr(p + strlen(str1), str2); - return p; -} - -static void -parse_smbclient_output(struct uri *uri, struct smb_connection_info *si, - struct string *page) -{ - unsigned char *line_start, *line_end; - enum { - SMB_TYPE_NONE, - SMB_TYPE_SHARE, - SMB_TYPE_SERVER, - SMB_TYPE_WORKGROUP - } type = SMB_TYPE_NONE; - size_t pos = 0; - int stop; - - assert(uri && si && page); - if_assert_failed return; - - add_to_string(page, "/"); - add_bytes_to_string(page, uri->data, uri->datalen); - add_to_string(page, "
");
-
-	line_start = si->text;
-	stop = !si->textlen;	/* Nothing to parse. */
-	while (!stop && (line_end = strchr(line_start, ASCII_LF))) {
-		unsigned char *line = line_start;
-		size_t line_len;
-		size_t start_offset = 0;
-
-		/* Handle \r\n case. Normally, do not occur on *nix. */
-		if (line_end > line_start && line_end[-1] == ASCII_CR)
-			 line_end--, start_offset++;
-
-		line_len = line_end - line_start;
-
-		/* Here we modify si->text content, this should not be
-		 * a problem as it is only used here. This prevents
-		 * allocation of memory for the line. */
-		*line_end = '\0';
-
-		/* And I got bored here with cleaning it up. --pasky */
-
-		if (si->list_type == SMB_LIST_SHARES) {
-			unsigned char *ll, *lll, *found;
-
-			if (!*line) type = SMB_TYPE_NONE;
-
-			found = find_strs(line, "Sharename", "Type");
-			if (found) {
-				pos = found - line;
-				type = SMB_TYPE_SHARE;
-				goto print_as_is;
-			}
-
-			found = find_strs(line, "Server", "Comment");
-			if (found) {
-				type = SMB_TYPE_SERVER;
-				goto print_as_is;
-			}
-
-			found = find_strs(line, "Workgroup", "Master");
-			if (found) {
-				pos = found - line;
-				type = SMB_TYPE_WORKGROUP;
-				goto print_as_is;
-			}
-
-			if (type == SMB_TYPE_NONE)
-				goto print_as_is;
-
-			for (ll = line; *ll; ll++)
-				if (!isspace(*ll) && *ll != '-')
-					goto print_next;
-
-			goto print_as_is;
-
-print_next:
-			for (ll = line; *ll; ll++)
-				if (!isspace(*ll))
-					break;
-
-			for (lll = ll; *lll; lll++)
-				if (isspace(*lll))
-					break;
-
-			switch (type) {
-			case SMB_TYPE_SHARE:
-			{
-				unsigned char *llll;
-
-				if (!strstr(lll, "Disk"))
-					goto print_as_is;
-
-				if (pos && pos < line_len
-				    && isspace(*(llll = line + pos - 1))
-				    && llll > ll) {
-					while (llll > ll && isspace(*llll))
-						llll--;
-					if (!isspace(*llll))
-						lll = llll + 1;
-				}
-
-				add_bytes_to_string(page, line, ll - line);
-				add_to_string(page, "");
-				add_bytes_to_string(page, ll, lll - ll);
-				add_to_string(page, "");
-				add_to_string(page, lll);
-				break;
-			}
-
-			case SMB_TYPE_WORKGROUP:
-				if (pos < line_len && pos
-				    && isspace(line[pos - 1])
-				    && !isspace(line[pos])) {
-					ll = line + pos;
-				} else {
-					for (ll = lll; *ll; ll++)
-						if (!isspace(*ll))
-							break;
-				}
-				for (lll = ll; *lll; lll++)
-					if (isspace(*lll))
-						break;
-				/* Fall-through */
-
-			case SMB_TYPE_SERVER:
-				add_bytes_to_string(page, line, ll - line);
-				add_to_string(page, "");
-				add_bytes_to_string(page, ll, lll - ll);
-				add_to_string(page, "");
-				add_to_string(page, lll);
-				break;
-
-			case SMB_TYPE_NONE:
-				goto print_as_is;
-			}
-
-		} else if (si->list_type == SMB_LIST_DIR) {
-			if (strstr(line, "NT_STATUS")) {
-				/* Error, stop after message. */
-				stop = 1;
-				goto print_as_is;
-			}
-
-			if (line_end - line_start >= 5
-			    && line_start[0] == ' '
-			    && line_start[1] == ' '
-			    && line_start[2] != ' ') {
-				int dir = 0;
-				int may_be_dir = 0;
-				unsigned char *p = line_end;
-				unsigned char *url = line_start + 2;
-
-				/* smbclient list parser
-				 * The boring thing is that output is
-				 * ambiguous in many ways:
-				 * filenames with more than one space,
-				 * etc...
-				 * This bloated code tries to do a not
-				 * so bad job. --Zas */
-
-/* directory                      D        0  Fri May  7 11:23:18 2004 */
-/* filename                             2444  Thu Feb 19 15:52:46 2004 */
-
-				/* Skip end of line */
-				while (p > url && !isdigit(*p)) p--;
-				if (p == url) goto print_as_is;
-
-				/* FIXME: Use parse_date()? */
-				/* year */
-				while (p > url && isdigit(*p)) p--;
-				if (p == url || !isspace(*p)) goto print_as_is;
-				while (p > url && isspace(*p)) p--;
-
-				/* seconds */
-				while (p > url && isdigit(*p)) p--;
-				if (p == url || *p != ':') goto print_as_is;
-				p--;
-
-				/* minutes */
-				while (p > url && isdigit(*p)) p--;
-				if (p == url || *p != ':') goto print_as_is;
-				p--;
-
-				/* hours */
-				while (p > url && isdigit(*p)) p--;
-				if (p == url || !isspace(*p)) goto print_as_is;
-				p--;
-
-				/* day as number */
-				while (p > url && isdigit(*p)) p--;
-				while (p > url && isspace(*p)) p--;
-				if (p == url) goto print_as_is;
-
-				/* month */
-				while (p > url && !isspace(*p)) p--;
-				if (p == url || !isspace(*p)) goto print_as_is;
-				p--;
-
-				/* day name */
-				while (p > url && !isspace(*p)) p--;
-				if (p == url || !isspace(*p)) goto print_as_is;
-				while (p > url && isspace(*p)) p--;
-
-				/* file size */
-				if (p == url || !isdigit(*p)) goto print_as_is;
-
-				if (*p == '0' && isspace(*(p - 1))) may_be_dir = 1;
-
-				while (p > url && isdigit(*p)) p--;
-				if (p == url) goto print_as_is;
-
-				/* Magic to determine if we have a
-				 * filename or a dirname. Thanks to
-				 * smbclient ambiguous output. */
-				{
-					unsigned char *pp = p;
-
-					while (pp > url && isspace(*pp)) pp--;
-
-					if (p - pp <= 8) {
-						while (pp > url
-						       && (*pp == 'D'
-							  || *pp == 'H'
-							  || *pp == 'A'
-							  || *pp == 'S'
-						          || *pp == 'R'
-							  || *pp == 'V')) {
-						        if (*pp == 'D' && may_be_dir)
-								dir = 1;
-							pp--;
-						}
-					}
-					while (pp > url && isspace(*pp)) pp--;
-					p = pp;
-				}
-
-				/* Don't display '.' directory */
-				if (p == url && *url == '.') goto ignored;
-				p++;
-
-				add_to_string(page, "  ");
-				add_bytes_to_string(page, url, p - url);
-				add_to_string(page, "");
-				add_bytes_to_string(page, p, line_end - p);
-
-			} else {
-				goto print_as_is;
-			}
-
-		} else {
-print_as_is:
-			add_bytes_to_string(page, line_start, line_len);
-		}
-
-		add_char_to_string(page, ASCII_LF);
-ignored:
-		line_start = line_end + start_offset + 1;
-	}
-
-	add_to_string(page, "
"); -} - -static void -end_smb_connection(struct connection *conn) -{ - struct smb_connection_info *si = conn->info; - struct uri *uri; - enum connection_state state = S_OK; - - if (smb_get_cache(conn)) return; - - if (conn->from) - goto bye; - - /* Ensure termination by LF + NUL chars, memory for this - * was reserved by smb_read_text(). */ - if (si->textlen && si->text[si->textlen - 1] != ASCII_LF) - si->text[si->textlen++] = ASCII_LF; - si->text[si->textlen] = '\0'; - - uri = conn->uri; - if (uri->datalen - && uri->data[uri->datalen - 1] != '/' - && uri->data[uri->datalen - 1] != '\\' - && (strstr(si->text, "NT_STATUS_FILE_IS_A_DIRECTORY") - || strstr(si->text, "NT_STATUS_ACCESS_DENIED") - || strstr(si->text, "ERRbadfile"))) { - redirect_cache(conn->cached, "/", 1, 0); - - } else { - struct string page; - - if (!init_string(&page)) { - state = S_OUT_OF_MEM; - goto bye; - } - - parse_smbclient_output(uri, si, &page); - - add_fragment(conn->cached, 0, page.source, page.length); - conn->from += page.length; - done_string(&page); - - mem_free_set(&conn->cached->content_type, stracpy("text/html")); - } - -bye: - close_socket(conn->socket); - close_socket(conn->data_socket); - abort_connection(conn, state); -} - - -void -smb_protocol_handler(struct connection *conn) -{ - int out_pipe[2] = { -1, -1 }; - int err_pipe[2] = { -1, -1 }; - unsigned char *share, *dir; - unsigned char *p; - pid_t cpid; - int dirlen; - struct smb_connection_info *si; - struct uri *uri; - - si = mem_calloc(1, sizeof(*si) + 2); - if (!si) { - abort_connection(conn, S_OUT_OF_MEM); - return; - } - conn->info = si; - - uri = conn->uri; - p = strchr(uri->data, '/'); - if (p && p - uri->data < uri->datalen) { - share = memacpy(uri->data, p - uri->data); - dir = p + 1; - /* FIXME: ensure @dir do not contain dangerous chars. --Zas */ - - } else if (uri->datalen) { - if (smb_get_cache(conn)) return; - - redirect_cache(conn->cached, "/", 1, 0); - abort_connection(conn, S_OK); - return; - - } else { - share = stracpy(""); - dir = ""; - } - - if (!share) { - abort_connection(conn, S_OUT_OF_MEM); - return; - } - - dirlen = strlen(dir); - if (!*share) { - si->list_type = SMB_LIST_SHARES; - } else if (!dirlen || dir[dirlen - 1] == '/' - || dir[dirlen - 1] == '\\') { - si->list_type = SMB_LIST_DIR; - } - - if (c_pipe(out_pipe) || c_pipe(err_pipe)) { - int s_errno = errno; - - if (out_pipe[0] >= 0) close(out_pipe[0]); - if (out_pipe[1] >= 0) close(out_pipe[1]); - mem_free(share); - abort_connection(conn, -s_errno); - return; - } - - conn->from = 0; - - cpid = fork(); - if (cpid == -1) { - int s_errno = errno; - - close(out_pipe[0]); - close(out_pipe[1]); - close(err_pipe[0]); - close(err_pipe[1]); - mem_free(share); - retry_connection(conn, -s_errno); - return; - } - - if (!cpid) { -#define SMBCLIENT "smbclient" -#define MAX_SMBCLIENT_ARGS 32 - int n = 0; - unsigned char *v[MAX_SMBCLIENT_ARGS]; - unsigned char *optstr; - - close(1); - dup2(out_pipe[1], 1); - close(2); - dup2(err_pipe[1], 2); - close(0); - dup2(open("/dev/null", O_RDONLY), 0); - - close_all_non_term_fd(); - close(out_pipe[0]); - close(err_pipe[0]); - - /* Usage: smbclient service [options] */ - v[n++] = SMBCLIENT; - - /* FIXME: handle alloc failures. */ - /* At this point, we are the child process. - * Maybe we just don't care if the child kills itself - * dereferencing a NULL pointer... -- Miciah */ - /* Leaving random core files after itself is not what a nice - * program does. Also, the user might also want to know, why - * the hell does he see nothing on the screen. --pasky */ - - if (*share) { - /* Construct service path. */ - asprintf((char **) &v[n++], "//%.*s/%s", - uri->hostlen, uri->host, share); - - /* Add password if any. */ - if (uri->passwordlen && !uri->userlen) { - v[n++] = memacpy(uri->password, uri->passwordlen); - } - } else { - /* Get a list of shares available on a host. */ - v[n++] = "-L"; - v[n++] = memacpy(uri->host, uri->hostlen); - } - - v[n++] = "-N"; /* Don't ask for a password. */ - v[n++] = "-E"; /* Write messages to stderr instead of stdout. */ - v[n++] = "-d 0"; /* Disable debug mode. */ - - if (uri->portlen) { - /* Connect to the specified port. */ - v[n++] = "-p"; - v[n++] = memacpy(uri->port, uri->portlen); - } - - if (uri->userlen) { - /* Set the network username. */ - v[n++] = "-U"; - if (!uri->passwordlen) { - /* No password. */ - v[n++] = memacpy(uri->user, uri->userlen); - } else { - /* With password. */ - asprintf((char **) &v[n++], "%.*s%%%.*s", - uri->userlen, uri->user, - uri->passwordlen, uri->password); - } - } - - if (*share) { - /* FIXME: use si->list_type here ?? --Zas */ - if (!dirlen || dir[dirlen - 1] == '/' || dir[dirlen - 1] == '\\') { - if (dirlen) { - /* Initial directory. */ - v[n++] = "-D"; - v[n++] = dir; - } - - v[n++] = "-c"; /* Execute semicolon separated commands. */ - v[n++] = "ls"; /* List files. */ - - } else { - /* Copy remote file to stdout. */ - unsigned char *s = straconcat("get \"", dir, "\" -", NULL); - unsigned char *ss = s; - - v[n++] = "-c"; /* Execute semicolon separated commands. */ - while ((ss = strchr(ss, '/'))) *ss = '\\'; /* Escape '/' */ - v[n++] = s; - } - } - - /* Optionally add SMB credentials file. */ - optstr = get_opt_str("protocol.smb.credentials"); - if (optstr[0]) { - v[n++] = "-A"; - v[n++] = optstr; - } - - v[n++] = NULL; /* End of arguments list. */ - assert(n < MAX_SMBCLIENT_ARGS); - - execvp(SMBCLIENT, (char **) v); - - /* FIXME: this message will never be displayed, since execvp() - * failed. */ - fprintf(stderr, SMBCLIENT " not found in $PATH"); - _exit(1); -#undef MAX_SMBCLIENT_ARGS -#undef SMBCLIENT - } - - mem_free(share); - - conn->data_socket->fd = out_pipe[0]; - conn->socket->fd = err_pipe[0]; - - close(out_pipe[1]); - close(err_pipe[1]); - - set_handlers(out_pipe[0], (select_handler_T) smb_got_data, NULL, NULL, conn); - set_handlers(err_pipe[0], (select_handler_T) smb_got_text, NULL, NULL, conn); - set_connection_state(conn, S_CONN); -} diff --git a/src/protocol/smb/smb2.c b/src/protocol/smb/smb2.c new file mode 100644 index 00000000..30908b32 --- /dev/null +++ b/src/protocol/smb/smb2.c @@ -0,0 +1,572 @@ +/* SMB protocol implementation */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#ifdef HAVE_LIBSMBCLIENT_H +#include +#endif +#include +#include +#include +#ifdef HAVE_FCNTL_H +#include /* OS/2 needs this after sys/types.h */ +#endif +#ifdef HAVE_UNISTD_H +#include +#endif + +#include "elinks.h" + +#include "cache/cache.h" +#include "config/options.h" +#include "intl/gettext/libintl.h" +#include "main/module.h" +#include "main/select.h" +#include "network/connection.h" +#include "network/socket.h" +#include "osdep/osdep.h" +#include "protocol/auth/auth.h" +#include "protocol/common.h" +#include "protocol/protocol.h" +#include "protocol/smb/smb.h" +#include "protocol/uri.h" +#include "util/conv.h" +#include "util/memory.h" +#include "util/string.h" + +/* These options are not used. */ +#if 0 +struct option_info smb_options[] = { + INIT_OPT_TREE("protocol", N_("SMB"), + "smb", 0, + N_("SAMBA specific options.")), + + INIT_OPT_STRING("protocol.smb", N_("Credentials"), + "credentials", 0, "", + N_("Credentials file passed to smbclient via -A option.")), + + NULL_OPTION_INFO, +}; +#endif + +struct module smb_protocol_module = struct_module( + /* name: */ N_("SMB"), + /* options: */ NULL, + /* hooks: */ NULL, + /* submodules: */ NULL, + /* data: */ NULL, + /* init: */ NULL, + /* done: */ NULL +); + +/* The child process generally does not bother to free the memory it + * allocates. When the process exits, the operating system will free + * the memory anyway. There is no point in changing this, because the + * child process also inherits memory allocations from the parent + * process, and it would be very cumbersome to free those. */ + +static void +smb_error(int error) +{ + fprintf(stderr, "text/x-error"); + printf("%d\n", error); + exit(1); +} + +static int +compare(const void *a, const void *b) +{ + const struct smbc_dirent **da = (const struct smbc_dirent **)a; + const struct smbc_dirent **db = (const struct smbc_dirent **)b; + int res = (*da)->smbc_type - (*db)->smbc_type; + + if (res) { + return res; + } + return strcmp((*da)->name, (*db)->name); +} + +static void +smb_add_link(struct string *string, const struct smbc_dirent *entry, + const unsigned char *text, const unsigned char dircolor[]) +{ + struct string uri_string; + + if (!init_string(&uri_string)) return; + encode_uri_string(&uri_string, entry->name, entry->namelen, 0); + + add_to_string(string, ""); + if (*dircolor) { + add_to_string(string, ""); + } + add_html_to_string(string, entry->name, entry->namelen); + if (*dircolor) { + add_to_string(string, ""); + } + add_to_string(string, ""); + if (text) add_to_string(string, text); +} + +static void +display_entry(const struct smbc_dirent *entry, const unsigned char dircolor[]) +{ + static const unsigned char zero = '\0'; + struct string string; + + if (!init_string(&string)) return; + + switch (entry->smbc_type) { + case SMBC_WORKGROUP: + smb_add_link(&string, entry, " WORKGROUP ", dircolor); + break; + case SMBC_SERVER: + smb_add_link(&string, entry, " SERVER ", dircolor); + if (entry->comment) { + add_html_to_string(&string, entry->comment, entry->commentlen); + } + break; + case SMBC_FILE_SHARE: + smb_add_link(&string, entry, " FILE SHARE ", dircolor); + if (entry->comment) { + add_html_to_string(&string, entry->comment, entry->commentlen); + } + break; + case SMBC_PRINTER_SHARE: + add_html_to_string(&string, entry->name, entry->namelen); + add_to_string(&string, " PRINTER "); + if (entry->comment) { + add_html_to_string(&string, entry->comment, entry->commentlen); + } + break; + case SMBC_COMMS_SHARE: + add_bytes_to_string(&string, entry->name, entry->namelen); + add_to_string(&string, " COMM"); + break; + case SMBC_IPC_SHARE: + add_bytes_to_string(&string, entry->name, entry->namelen); + add_to_string(&string, " IPC"); + break; + case SMBC_DIR: + smb_add_link(&string, entry, NULL, dircolor); + break; + case SMBC_LINK: + smb_add_link(&string, entry, " Link", &zero); + break; + case SMBC_FILE: + smb_add_link(&string, entry, NULL, &zero); + break; + default: + /* unknown type */ + break; + } + puts(string.source); + done_string(&string); +} + +static void +sort_and_display_entries(int dir, const unsigned char dircolor[]) +{ + struct smbc_dirent *fentry, **table = NULL; + int size = 0; + int i; + + while ((fentry = smbc_readdir(dir))) { + struct smbc_dirent **new_table, *new_entry; + unsigned int commentlen = fentry->commentlen; + unsigned int namelen = fentry->namelen; + + if (!strcmp(fentry->name, ".")) + continue; + + /* In libsmbclient 3.0.10, @smbc_dirent.namelen and + * @smbc_dirent.commentlen include the null characters + * (tested with GDB). In libsmbclient 3.0.24, they + * don't. This is related to Samba bug 3030. Adjust + * the lengths to exclude the null characters, so that + * other code need not care. + * + * Make all changes to local copies rather than + * directly to *@fentry, so that there's no chance of + * ELinks messing up whatever mechanism libsmbclient + * will use to free @fentry. */ + if (commentlen > 0 && fentry->comment[commentlen - 1] == '\0') + commentlen--; + if (namelen > 0 && fentry->name[namelen - 1] == '\0') + namelen--; + + /* libsmbclient seems to place the struct smbc_dirent, + * the name string, and the comment string all in one + * block of memory, which then is smbc_dirent.dirlen + * bytes long. This has however not been really + * documented, so ELinks should not assume copying + * fentry->dirlen bytes will copy the comment too. + * Yet, it would be wasteful to copy both dirlen bytes + * and then the comment string separately. What we do + * here is ignore fentry->dirlen and recompute the + * size based on namelen. */ + new_entry = (struct smbc_dirent *) + memacpy((const unsigned char *) fentry, + offsetof(struct smbc_dirent, name) + + namelen); /* memacpy appends '\0' */ + if (!new_entry) + continue; + new_entry->namelen = namelen; + new_entry->commentlen = commentlen; + if (fentry->comment) + new_entry->comment = memacpy(fentry->comment, commentlen); + if (!new_entry->comment) + new_entry->commentlen = 0; + + new_table = mem_realloc(table, (size + 1) * sizeof(*table)); + if (!new_table) + continue; + table = new_table; + table[size] = new_entry; + size++; + } + /* If size==0, then table==NULL. According to ISO/IEC 9899:1999 + * 7.20.5p1, the NULL must not be given to qsort. */ + if (size > 0) + qsort(table, size, sizeof(*table), compare); + + for (i = 0; i < size; i++) { + display_entry(table[i], dircolor); + } +} + +static void +smb_directory(int dir, struct uri *uri) +{ + struct string buf; + unsigned char dircolor[8] = ""; + + if (init_directory_listing(&buf, uri) != S_OK) { + smb_error(-S_OUT_OF_MEM); + } + + fprintf(stderr, "text/html"); + fclose(stderr); + + puts(buf.source); + + if (get_opt_bool("document.browse.links.color_dirs")) { + color_to_string(get_opt_color("document.colors.dirs"), + dircolor); + } + + sort_and_display_entries(dir, dircolor); + puts("
"); + smbc_closedir(dir); + exit(0); +} + +static void +smb_auth(const char *srv, const char *shr, char *wg, int wglen, char *un, + int unlen, char *pw, int pwlen) +{ + /* TODO */ +} + +#define READ_SIZE 4096 + +static void +do_smb(struct connection *conn) +{ + struct uri *uri = conn->uri; + struct auth_entry *auth = find_auth(uri); + struct string string; + unsigned char *url; + int dir; + + if ((uri->userlen && uri->passwordlen) || !auth) { + url = get_uri_string(uri, URI_BASE); + } else { + unsigned char *uri_string = get_uri_string(uri, URI_HOST | URI_PORT | URI_DATA); + + if (!uri_string || !init_string(&string)) { + smb_error(-S_OUT_OF_MEM); + } + /* Must URI-encode the username and password to avoid + * ambiguity if they contain "/:@" characters. + * Libsmbclient then decodes them again, and the + * server gets them as they were in auth->user and + * auth->password, i.e. as the user typed them in the + * auth dialog. This implies that, if the username or + * password contains some characters or bytes that the + * user cannot directly type, then she cannot enter + * them. If that becomes an actual problem, it should + * be fixed in the auth dialog, e.g. by providing a + * hexadecimal input mode. */ + add_to_string(&string, "smb://"); + encode_uri_string(&string, auth->user, -1, 1); + add_char_to_string(&string, ':'); + encode_uri_string(&string, auth->password, -1, 1); + add_char_to_string(&string, '@'); + add_to_string(&string, uri_string); + url = string.source; + } + + if (!url) { + smb_error(-S_OUT_OF_MEM); + } + if (smbc_init(smb_auth, 0)) { + smb_error(errno); + }; + + dir = smbc_opendir(url); + if (dir >= 0) { + smb_directory(dir, conn->uri); + } else { + const int errno_from_opendir = errno; + char buf[READ_SIZE]; + struct stat sb; + int r, res; + int file = smbc_open(url, O_RDONLY, 0); + + if (file < 0) { + /* If we're opening the list of shares without + * proper authentication, then smbc_opendir + * fails with EACCES and smbc_open fails with + * ENOENT. In this case, return the EACCES so + * that the parent ELinks process will prompt + * for credentials. */ + if (errno == ENOENT && errno_from_opendir == EACCES) + errno = errno_from_opendir; + smb_error(errno); + } + + res = smbc_fstat(file, &sb); + if (res) { + smb_error(res); + } + /* filesize */ + fprintf(stderr, "%" OFF_T_FORMAT, sb.st_size); + fclose(stderr); + + while ((r = smbc_read(file, buf, READ_SIZE)) > 0) { + if (safe_write(STDOUT_FILENO, buf, r) <= 0) + break; + } + smbc_close(file); + exit(0); + } +} + +#undef READ_SIZE + +/* Kill the current connection and ask for a username/password for the next + * try. */ +static void +prompt_username_pw(struct connection *conn) +{ + add_auth_entry(conn->uri, "Samba", NULL, NULL, 0); + abort_connection(conn, S_OK); +} + +static void +smb_got_error(struct socket *socket, struct read_buffer *rb) +{ + int len = rb->length; + struct connection *conn = socket->conn; + int error; + + if (len < 0) { + abort_connection(conn, -errno); + return; + } + + /* There should be free space in the buffer, because + * @alloc_read_buffer allocated several kibibytes, and the + * child process wrote only an integer and a newline to the + * pipe. */ + assert(rb->freespace >= 1); + if_assert_failed { + abort_connection(conn, S_INTERNAL); + return; + } + rb->data[len] = '\0'; + error = atoi(rb->data); + kill_buffer_data(rb, len); + switch (error) { + case EACCES: + prompt_username_pw(conn); + break; + default: + abort_connection(conn, -error); + break; + } +} + +static void +smb_got_data(struct socket *socket, struct read_buffer *rb) +{ + int len = rb->length; + struct connection *conn = socket->conn; + + if (len < 0) { + abort_connection(conn, -errno); + return; + } + + if (!len) { + abort_connection(conn, S_OK); + return; + } + + socket->state = SOCKET_END_ONCLOSE; + conn->received += len; + if (add_fragment(conn->cached, conn->from, rb->data, len) == 1) + conn->tries = 0; + conn->from += len; + kill_buffer_data(rb, len); + + read_from_socket(socket, rb, S_TRANS, smb_got_data); +} + +static void +smb_got_header(struct socket *socket, struct read_buffer *rb) +{ + struct connection *conn = socket->conn; + struct read_buffer *buf; + int error = 0; + + conn->cached = get_cache_entry(conn->uri); + if (!conn->cached) { + /* Even though these are pipes rather than real + * sockets, call close_socket instead of close, to + * ensure that abort_connection won't try to close the + * file descriptors again. (Could we skip the calls + * and assume abort_connection will do them?) */ + close_socket(socket); + close_socket(conn->data_socket); + abort_connection(conn, S_OUT_OF_MEM); + return; + } + socket->state = SOCKET_END_ONCLOSE; + + if (rb->length > 0) { + unsigned char *ctype = memacpy(rb->data, rb->length); + + if (ctype && *ctype) { + if (!strcmp(ctype, "text/x-error")) { + error = 1; + mem_free(ctype); + } else { + if (ctype[0] >= '0' && ctype[0] <= '9') { +#ifdef HAVE_ATOLL + conn->est_length = (off_t)atoll(ctype); +#else + conn->est_length = (off_t)atol(ctype); +#endif + mem_free(ctype); + + /* avoid error */ + if (!conn->est_length) { + abort_connection(conn, S_OK); + return; + } + } + else mem_free_set(&conn->cached->content_type, ctype); + } + } else { + mem_free_if(ctype); + } + } + + buf = alloc_read_buffer(conn->data_socket); + if (!buf) { + close_socket(socket); + close_socket(conn->data_socket); + abort_connection(conn, S_OUT_OF_MEM); + return; + } + if (error) { + mem_free_set(&conn->cached->content_type, stracpy("text/html")); + read_from_socket(conn->data_socket, buf, S_CONN, smb_got_error); + } else { + read_from_socket(conn->data_socket, buf, S_CONN, smb_got_data); + } +} + +void +smb_protocol_handler(struct connection *conn) +{ + int smb_pipe[2] = { -1, -1 }; + int header_pipe[2] = { -1, -1 }; + pid_t cpid; + + if (c_pipe(smb_pipe) || c_pipe(header_pipe)) { + int s_errno = errno; + + if (smb_pipe[0] >= 0) close(smb_pipe[0]); + if (smb_pipe[1] >= 0) close(smb_pipe[1]); + if (header_pipe[0] >= 0) close(header_pipe[0]); + if (header_pipe[1] >= 0) close(header_pipe[1]); + abort_connection(conn, -s_errno); + return; + } + conn->from = 0; + conn->unrestartable = 1; + find_auth(conn->uri); /* remember username and password */ + + cpid = fork(); + if (cpid == -1) { + int s_errno = errno; + + close(smb_pipe[0]); + close(smb_pipe[1]); + close(header_pipe[0]); + close(header_pipe[1]); + retry_connection(conn, -s_errno); + return; + } + + if (!cpid) { + dup2(smb_pipe[1], 1); + dup2(open("/dev/null", O_RDONLY), 0); + dup2(header_pipe[1], 2); + close(smb_pipe[0]); + close(header_pipe[0]); + + /* There may be outgoing data in stdio buffers + * inherited from the parent process. The parent + * process is going to write this data, so the child + * process must not do that. Closing the file + * descriptors ensures this. + * + * FIXME: If something opens more files and gets the + * same file descriptors and does not close them + * before exit(), then stdio may attempt to write the + * buffers to the wrong files. This might happen for + * example if libsmbclient calls syslog(). */ + close_all_non_term_fd(); + do_smb(conn); + + } else { + struct read_buffer *buf2; + + conn->data_socket->fd = smb_pipe[0]; + conn->socket->fd = header_pipe[0]; + set_nonblocking_fd(conn->data_socket->fd); + set_nonblocking_fd(conn->socket->fd); + close(smb_pipe[1]); + close(header_pipe[1]); + buf2 = alloc_read_buffer(conn->socket); + if (!buf2) { + close_socket(conn->data_socket); + close_socket(conn->socket); + abort_connection(conn, S_OUT_OF_MEM); + return; + } + read_from_socket(conn->socket, buf2, S_CONN, smb_got_header); + } +} diff --git a/src/protocol/uri.c b/src/protocol/uri.c index d33ddf3c..df226464 100644 --- a/src/protocol/uri.c +++ b/src/protocol/uri.c @@ -47,14 +47,14 @@ end_of_dir(unsigned char c) } static inline int -is_uri_dir_sep(struct uri *uri, unsigned char pos) +is_uri_dir_sep(const struct uri *uri, unsigned char pos) { return (uri->protocol == PROTOCOL_FILE ? dir_sep(pos) : pos == '/'); } int -is_ip_address(unsigned char *address, int addresslen) +is_ip_address(const unsigned char *address, int addresslen) { /* The @address has well defined limits so it would be a shame to * allocate it. */ @@ -90,10 +90,10 @@ is_ip_address(unsigned char *address, int addresslen) int -end_with_known_tld(unsigned char *s, int slen) +end_with_known_tld(const unsigned char *s, int slen) { int i; - static const unsigned char *tld[] = + static const unsigned char *const tld[] = { "com", "edu", "net", "org", "gov", "mil", "int", "biz", "arpa", @@ -146,7 +146,7 @@ check_whether_file_exists(unsigned char *name) } static int -check_uri_file(unsigned char *name) +check_uri_file(const unsigned char *name) { /* Check POST_CHAR etc ... */ static const unsigned char chars[] = POST_CHAR_S "#?"; @@ -194,7 +194,7 @@ parse_uri(struct uri *uri, unsigned char *uristring) unsigned char *lbracket, *rbracket; #endif - assertm(uristring, "No uri to parse."); + assertm(uristring != NULL, "No uri to parse."); memset(uri, 0, sizeof(*uri)); /* Nothing to do for an empty url. */ @@ -241,11 +241,18 @@ parse_uri(struct uri *uri, unsigned char *uristring) } else if (uri->protocol == PROTOCOL_FILE) { int datalen = check_uri_file(prefix_end); + unsigned char *frag_or_post = prefix_end + datalen; /* Extract the fragment part. */ - if (datalen >= 0 && prefix_end[datalen] == '#') { - uri->fragment = prefix_end + datalen + 1; - uri->fragmentlen = strlen(uri->fragment); + if (datalen >= 0) { + if (*frag_or_post == '#') { + uri->fragment = frag_or_post + 1; + uri->fragmentlen = strcspn(uri->fragment, POST_CHAR_S); + frag_or_post = uri->fragment + uri->fragmentlen; + } + if (*frag_or_post == POST_CHAR) { + uri->post = frag_or_post + 1; + } } else { datalen = strlen(prefix_end); } @@ -402,10 +409,10 @@ parse_uri(struct uri *uri, unsigned char *uristring) } int -get_uri_port(struct uri *uri) +get_uri_port(const struct uri *uri) { if (uri->port && uri->portlen) { - unsigned char *end = uri->port; + const unsigned char *end = uri->port; int port = strtol(uri->port, (char **) &end, 10); if (end != uri->port) { @@ -420,7 +427,8 @@ get_uri_port(struct uri *uri) #define can_compare_uri_components(comp) !(((comp) & (URI_SPECIAL | URI_IDN))) static inline int -compare_component(unsigned char *a, int alen, unsigned char *b, int blen) +compare_component(const unsigned char *a, int alen, + const unsigned char *b, int blen) { /* Check that the length and the strings are both set or unset */ if (alen != blen || !!a != !!b) return 0; @@ -435,7 +443,8 @@ compare_component(unsigned char *a, int alen, unsigned char *b, int blen) #define wants(x) (components & (x)) int -compare_uri(struct uri *a, struct uri *b, enum uri_component components) +compare_uri(const struct uri *a, const struct uri *b, + enum uri_component components) { if (a == b) return 1; if (!components) return 0; @@ -464,7 +473,7 @@ compare_uri(struct uri *a, struct uri *b, enum uri_component components) /* We might need something more intelligent than this Swiss army knife. */ struct string * -add_uri_to_string(struct string *string, struct uri *uri, +add_uri_to_string(struct string *string, const struct uri *uri, enum uri_component components) { /* Custom or unknown keep the URI untouched. */ @@ -571,8 +580,8 @@ add_uri_to_string(struct string *string, struct uri *uri, /* We can not test uri->datalen here since we need to always * add '/'. */ if (wants(URI_PATH) || wants(URI_FILENAME)) { - unsigned char *filename = uri->data; - unsigned char *pos; + const unsigned char *filename = uri->data; + const unsigned char *pos; assertm(!wants(URI_FILENAME) || components == URI_FILENAME, "URI_FILENAME should be used alone %d", components); @@ -595,7 +604,7 @@ add_uri_to_string(struct string *string, struct uri *uri, } if (wants(URI_QUERY) && uri->datalen) { - unsigned char *query = memchr(uri->data, '?', uri->datalen); + const unsigned char *query = memchr(uri->data, '?', uri->datalen); assertm(URI_QUERY == components, "URI_QUERY should be used alone %d", components); @@ -635,7 +644,7 @@ add_uri_to_string(struct string *string, struct uri *uri, #undef wants unsigned char * -get_uri_string(struct uri *uri, enum uri_component components) +get_uri_string(const struct uri *uri, enum uri_component components) { struct string string; @@ -778,7 +787,7 @@ normalize_uri(struct uri *uri, unsigned char *uristring) * backend can understand. No host parts etc, that is what this function is * supposed to chew. */ static struct uri * -transform_file_url(struct uri *uri, unsigned char *cwd) +transform_file_url(struct uri *uri, const unsigned char *cwd) { unsigned char *path = uri->data; @@ -916,7 +925,7 @@ join_urls(struct uri *base, unsigned char *rel) } } - assertm(base->data, "bad base url"); + assertm(base->data != NULL, "bad base url"); if_assert_failed return NULL; path = base->data; @@ -1194,7 +1203,7 @@ parse_uri: ? uri.port + uri.portlen - struri(&uri) : uri.host + uri.hostlen - struri(&uri) + uri.ipv6 /* ']' */; - assertm(uri.host, "uri.host not set after no host slash error"); + assertm(uri.host != NULL, "uri.host not set after no host slash error"); insert_in_string(&newurl, offset, "/", 1); goto parse_uri; } @@ -1319,11 +1328,11 @@ safe_char(unsigned char c) } void -encode_uri_string(struct string *string, unsigned char *name, int namelen, +encode_uri_string(struct string *string, const unsigned char *name, int namelen, int convert_slashes) { unsigned char n[4]; - unsigned char *end; + const unsigned char *end; n[0] = '%'; n[3] = '\0'; @@ -1589,7 +1598,7 @@ done_uri(struct uri *uri) item = get_hash_item(uri_cache.map, string, length); entry = item ? item->value : NULL; - assertm(entry, "Releasing unknown URI [%s]", string); + assertm(entry != NULL, "Releasing unknown URI [%s]", string); del_hash_item(uri_cache.map, item); mem_free(entry); diff --git a/src/protocol/uri.h b/src/protocol/uri.h index f0deb434..426bd11c 100644 --- a/src/protocol/uri.h +++ b/src/protocol/uri.h @@ -247,25 +247,28 @@ unsigned char *normalize_uri(struct uri *uri, unsigned char *uristring); /* Check if two URIs are equal. If @components are 0 simply compare the whole * URI else only compare the specific parts. */ -int compare_uri(struct uri *uri1, struct uri *uri2, enum uri_component components); +int compare_uri(const struct uri *uri1, const struct uri *uri2, + enum uri_component components); /* These functions recreate the URI string part by part. */ /* The @components bitmask describes the set of URI components used for * construction of the URI string. */ /* Adds the components to an already initialized string. */ -struct string *add_uri_to_string(struct string *string, struct uri *uri, enum uri_component components); +struct string *add_uri_to_string(struct string *string, const struct uri *uri, + enum uri_component components); /* Takes an uri string, parses it and adds the desired components. Useful if * there is no struct uri around. */ struct string *add_string_uri_to_string(struct string *string, unsigned char *uristring, enum uri_component components); /* Returns the new URI string or NULL upon an error. */ -unsigned char *get_uri_string(struct uri *uri, enum uri_component components); +unsigned char *get_uri_string(const struct uri *uri, + enum uri_component components); /* Returns either the uri's port number if available or the protocol's * default port. It is zarro for user protocols. */ -int get_uri_port(struct uri *uri); +int get_uri_port(const struct uri *uri); /* Tcp port range */ #define LOWEST_PORT 0 @@ -278,7 +281,7 @@ int get_uri_port(struct uri *uri); /* Encode and add @namelen bytes from @name to @string. If @namelen is -1 it is * set to strlen(@name). If the boolean convert_slashes is zero '/'-chars will * not be encoded. */ -void encode_uri_string(struct string *string, unsigned char *name, int namelen, +void encode_uri_string(struct string *string, const unsigned char *name, int namelen, int convert_slashes); /* special version for Windows directory listing */ @@ -304,7 +307,7 @@ unsigned char *join_urls(struct uri *base, unsigned char *relative); /* Return position if end of string @s matches a known tld or -1 if not. * If @slen < 0, then string length will be obtained by a strlen() call, * else @slen is used as @s length. */ -int end_with_known_tld(unsigned char *s, int slen); +int end_with_known_tld(const unsigned char *s, int slen); static inline int @@ -314,6 +317,6 @@ get_real_uri_length(struct uri *uri) } /* Checks if @address contains a valid IP address. */ -int is_ip_address(unsigned char *address, int addresslen); +int is_ip_address(const unsigned char *address, int addresslen); #endif diff --git a/src/protocol/user.c b/src/protocol/user.c index e00cf720..3a92ead7 100644 --- a/src/protocol/user.c +++ b/src/protocol/user.c @@ -217,32 +217,45 @@ static unsigned char * save_form_data_to_file(struct uri *uri) { unsigned char *filename = get_tempdir_filename("elinks-XXXXXX"); - int formfd; - FILE *formfile; + int fd; + FILE *fp; + size_t nmemb, len; + unsigned char *formdata; if (!filename) return NULL; - formfd = safe_mkstemp(filename); - if (formfd < 0) { + fd = safe_mkstemp(filename); + if (fd < 0) { mem_free(filename); return NULL; } - formfile = fdopen(formfd, "w"); - if (!formfile) { + if (!uri->post) return filename; + + /* Jump the content type */ + formdata = strchr(uri->post, '\n'); + formdata = formdata ? formdata + 1 : uri->post; + len = strlen(formdata); + if (len == 0) return filename; + + fp = fdopen(fd, "w"); + if (!fp) { + +error: + unlink(filename); mem_free(filename); - close(formfd); + close(fd); return NULL; } - if (uri->post) { - /* Jump the content type */ - unsigned char *formdata = strchr(uri->post, '\n'); - - formdata = formdata ? formdata + 1 : uri->post; - fwrite(formdata, strlen(formdata), 1, formfile); + nmemb = fwrite(formdata, len, 1, fp); + if (nmemb != 1) { + fclose(fp); + goto error; } - fclose(formfile); + + if (fclose(fp) != 0) + goto error; return filename; } @@ -251,7 +264,7 @@ void user_protocol_handler(struct session *ses, struct uri *uri) { unsigned char *subj = NULL, *prog; - unsigned char *formfilename; + unsigned char *filename; prog = get_user_program(ses->tab->term, struri(uri), uri->protocollen); if (!prog || !*prog) { @@ -280,19 +293,19 @@ user_protocol_handler(struct session *ses, struct uri *uri) } } - formfilename = save_form_data_to_file(uri); + filename = save_form_data_to_file(uri); - prog = subst_cmd(prog, uri, subj, formfilename); + prog = subst_cmd(prog, uri, subj, filename); mem_free_if(subj); if (prog) { - unsigned char *delete = empty_string_or_(formfilename); + unsigned char *delete = empty_string_or_(filename); exec_on_terminal(ses->tab->term, prog, delete, 1); mem_free(prog); - } else if (formfilename) { - unlink(formfilename); + } else if (filename) { + unlink(filename); } - mem_free_if(formfilename); + mem_free_if(filename); } diff --git a/src/scripting/guile/core.c b/src/scripting/guile/core.c index 6c0b839d..412bb7bb 100644 --- a/src/scripting/guile/core.c +++ b/src/scripting/guile/core.c @@ -54,7 +54,8 @@ init_guile(struct module *module) /* Remember the current module. */ user_module = scm_current_module(); - path = straconcat(elinks_home, GUILE_HOOKS_FILENAME, NULL); + path = straconcat(elinks_home, GUILE_HOOKS_FILENAME, + (unsigned char *) NULL); if (!path) return; if (file_can_read(path)) { @@ -76,7 +77,8 @@ init_guile(struct module *module) mem_free(path); - path = straconcat(elinks_home, GUILE_USERHOOKS_FILENAME, NULL); + path = straconcat(elinks_home, GUILE_USERHOOKS_FILENAME, + (unsigned char *) NULL); if (!path) return; if (file_can_read(path)) scm_c_primitive_load_path(path); diff --git a/src/scripting/guile/guile.c b/src/scripting/guile/guile.c index 928e84cd..16f59dcc 100644 --- a/src/scripting/guile/guile.c +++ b/src/scripting/guile/guile.c @@ -6,13 +6,14 @@ #include "elinks.h" +#include "intl/gettext/libintl.h" #include "main/module.h" #include "scripting/guile/core.h" #include "scripting/guile/hooks.h" struct module guile_scripting_module = struct_module( - /* name: */ "Guile", + /* name: */ N_("Guile"), /* options: */ NULL, /* events: */ guile_scripting_hooks, /* submodules: */ NULL, diff --git a/src/scripting/lua/core.c b/src/scripting/lua/core.c index 96b96d8f..fcd71764 100644 --- a/src/scripting/lua/core.c +++ b/src/scripting/lua/core.c @@ -71,7 +71,13 @@ static void handle_ref(LS, struct session *ses, int func_ref, static int l_alert(LS) { - alert_lua_error((unsigned char *) lua_tostring(S, 1)); + unsigned char *msg = (unsigned char *) lua_tostring(S, 1); + + /* Don't crash if a script calls e.g. error(nil) or error(error). */ + if (msg == NULL) + msg = "(cannot convert the error message to a string)"; + + alert_lua_error(msg); return 0; } @@ -392,7 +398,7 @@ l_edit_bookmark_dialog(LS) add_dlg_end(dlg, L_EDIT_BMK_WIDGETS_COUNT); - do_dialog(term, dlg, getml(dlg, NULL)); + do_dialog(term, dlg, getml(dlg, (void *) NULL)); lua_pushnumber(S, 1); return 1; @@ -473,7 +479,7 @@ l_xdialog(LS) add_dlg_end(dlg, nitems); - do_dialog(term, dlg, getml(dlg, NULL)); + do_dialog(term, dlg, getml(dlg, (void *) NULL)); lua_pushnumber(S, 1); return 1; @@ -491,7 +497,7 @@ static int l_set_option(LS) { int nargs; - struct option *opt, *current; + struct option *opt; const char *name; nargs = lua_gettop(S); @@ -536,11 +542,8 @@ l_set_option(LS) goto lua_error; } - opt->flags |= OPT_TOUCHED; - /* Call hook */ - current = opt; - call_change_hooks(lua_ses, current, opt); + option_changed(lua_ses, opt); return 1; lua_error: @@ -582,7 +585,7 @@ l_get_option(LS) { unsigned char *cp_name; - cp_name = get_cp_mime_name(opt->value.number); + cp_name = get_cp_config_name(opt->value.number); lua_pushstring(S, cp_name); break; } @@ -602,7 +605,7 @@ l_get_option(LS) { color_T color; unsigned char hexcolor[8]; - unsigned char *strcolor; + const unsigned char *strcolor; color = opt->value.color; strcolor = get_color_string(color, hexcolor); @@ -642,7 +645,8 @@ eval_function(LS, int num_args, int num_results) static void do_hooks_file(LS, unsigned char *prefix, unsigned char *filename) { - unsigned char *file = straconcat(prefix, STRING_DIR_SEP, filename, NULL); + unsigned char *file = straconcat(prefix, STRING_DIR_SEP, filename, + (unsigned char *) NULL); if (!file) return; diff --git a/src/scripting/lua/lua.c b/src/scripting/lua/lua.c index 34aa996d..6458b0f2 100644 --- a/src/scripting/lua/lua.c +++ b/src/scripting/lua/lua.c @@ -6,13 +6,14 @@ #include "elinks.h" +#include "intl/gettext/libintl.h" #include "main/module.h" #include "scripting/lua/core.h" #include "scripting/lua/hooks.h" struct module lua_scripting_module = struct_module( - /* name: */ "Lua", + /* name: */ N_("Lua"), /* options: */ NULL, /* hooks: */ lua_scripting_hooks, /* submodules: */ NULL, diff --git a/src/scripting/perl/perl.c b/src/scripting/perl/perl.c index ee714f4b..87c2b096 100644 --- a/src/scripting/perl/perl.c +++ b/src/scripting/perl/perl.c @@ -6,13 +6,14 @@ #include "elinks.h" +#include "intl/gettext/libintl.h" #include "main/module.h" #include "scripting/perl/core.h" #include "scripting/perl/hooks.h" struct module perl_scripting_module = struct_module( - /* name: */ "Perl", + /* name: */ N_("Perl"), /* options: */ NULL, /* hooks: */ perl_scripting_hooks, /* submodules: */ NULL, diff --git a/src/scripting/python/dialogs.c b/src/scripting/python/dialogs.c index 009ede76..c3482623 100644 --- a/src/scripting/python/dialogs.c +++ b/src/scripting/python/dialogs.c @@ -78,12 +78,12 @@ python_info_box(PyObject *self, PyObject *args, PyObject *kwargs) title = stracpy(title); if (!title) goto free_text; - (void) msg_box(python_ses->tab->term, getml(title, NULL), + (void) msg_box(python_ses->tab->term, getml(title, (void *) NULL), MSGBOX_NO_INTL | MSGBOX_SCROLLABLE | MSGBOX_FREE_TEXT, title, ALIGN_LEFT, text, NULL, 1, - N_("~OK"), NULL, B_ENTER | B_ESC); + MSG_BOX_BUTTON(N_("~OK"), NULL, B_ENTER | B_ESC)); Py_INCREF(Py_None); return Py_None; @@ -206,7 +206,8 @@ python_input_box(PyObject *self, PyObject *args, PyObject *kwargs) hop->callback = callback; Py_INCREF(callback); - input_dialog(python_ses->tab->term, getml(prompt, title, initial, NULL), + input_dialog(python_ses->tab->term, + getml(prompt, (void *) title, (void *) initial, (void *) NULL), title, prompt, hop, NULL, MAX_STR_LEN, initial, 0, 0, NULL, diff --git a/src/scripting/python/document.c b/src/scripting/python/document.c index c7a1399f..76decbef 100644 --- a/src/scripting/python/document.c +++ b/src/scripting/python/document.c @@ -9,8 +9,9 @@ #include "elinks.h" #include "cache/cache.h" +#include "document/document.h" +#include "document/view.h" #include "scripting/python/core.h" -#include "session/location.h" #include "session/session.h" /* Python interface to get the current document's body. */ @@ -23,8 +24,9 @@ If a document is being viewed, return its body; otherwise return None.\n"); static PyObject * python_current_document(PyObject *self, PyObject *args) { - if (python_ses && have_location(python_ses)) { - struct cache_entry *cached = find_in_cache(cur_loc(python_ses)->vs.uri); + if (python_ses && python_ses->doc_view + && python_ses->doc_view->document) { + struct cache_entry *cached = python_ses->doc_view->document->cached; struct fragment *f = cached ? cached->frag.next : NULL; if (f) return PyString_FromStringAndSize(f->data, f->length); @@ -45,8 +47,9 @@ otherwise return None.\n"); static PyObject * python_current_header(PyObject *self, PyObject *args) { - if (python_ses && have_location(python_ses)) { - struct cache_entry *cached = find_in_cache(cur_loc(python_ses)->vs.uri); + if (python_ses && python_ses->doc_view + && python_ses->doc_view->document) { + struct cache_entry *cached = python_ses->doc_view->document->cached; if (cached && cached->head) return PyString_FromString(cached->head); diff --git a/src/scripting/python/hooks.c b/src/scripting/python/hooks.c index 23a07f07..9ff63df1 100644 --- a/src/scripting/python/hooks.c +++ b/src/scripting/python/hooks.c @@ -15,7 +15,6 @@ #include "main/event.h" #include "protocol/uri.h" #include "scripting/python/core.h" -#include "session/location.h" #include "session/session.h" #include "util/memory.h" #include "util/string.h" @@ -64,28 +63,7 @@ script_hook_url(va_list ap, void *data) python_ses = ses; - /* - * Historical note: The only reason the goto and follow hooks are - * treated differently is to maintain backwards compatibility for - * people who already have a goto_url_hook() function in hooks.py - * that expects a second argument. If we were starting over from - * scratch, we could treat the goto and follow hooks identically and - * simply pass @url as the sole argument in both cases; the Python - * code for the goto hook no longer needs its @current_url argument - * since it could instead determine the current URL by calling the - * Python interpreter's elinks.current_url() function. - */ - if (!strcmp(method, "goto_url_hook")) { - unsigned char *current_url = NULL; - - if (python_ses && have_location(python_ses)) - current_url = struri(cur_loc(ses)->vs.uri); - - result = PyObject_CallMethod(python_hooks, method, "ss", *url, - current_url); - } else { - result = PyObject_CallMethod(python_hooks, method, "s", *url); - } + result = PyObject_CallMethod(python_hooks, method, "s", *url); if (!result || !replace_with_python_string(url, result)) alert_python_error(); diff --git a/src/scripting/python/menu.c b/src/scripting/python/menu.c index a648d626..86f499c6 100644 --- a/src/scripting/python/menu.c +++ b/src/scripting/python/menu.c @@ -140,7 +140,7 @@ python_menu(PyObject *self, PyObject *args, PyObject *kwargs) * Keep track of all the memory we allocate so we'll be able to free * it in case any error prevents us from displaying the menu. */ - ml = getml(menu, NULL); + ml = getml(menu, (void *) NULL); if (!ml) { mem_free(menu); return PyErr_NoMemory(); diff --git a/src/scripting/python/python.c b/src/scripting/python/python.c index e1bc3744..da33c03a 100644 --- a/src/scripting/python/python.c +++ b/src/scripting/python/python.c @@ -8,13 +8,14 @@ #include "elinks.h" +#include "intl/gettext/libintl.h" #include "main/module.h" #include "scripting/python/core.h" #include "scripting/python/hooks.h" struct module python_scripting_module = struct_module( - /* name: */ "Python", + /* name: */ N_("Python"), /* options: */ NULL, /* hooks: */ python_scripting_hooks, /* submodules: */ NULL, diff --git a/src/scripting/ruby/core.c b/src/scripting/ruby/core.c index 7e2ba841..fdf0bffb 100644 --- a/src/scripting/ruby/core.c +++ b/src/scripting/ruby/core.c @@ -233,7 +233,8 @@ init_ruby(struct module *module) init_erb_module(); if (elinks_home) { - path = straconcat(elinks_home, RUBY_HOOKS_FILENAME, NULL); + path = straconcat(elinks_home, RUBY_HOOKS_FILENAME, + (unsigned char *) NULL); } else { path = stracpy(CONFDIR STRING_DIR_SEP RUBY_HOOKS_FILENAME); diff --git a/src/scripting/ruby/ruby.c b/src/scripting/ruby/ruby.c index febe7362..ef2ca794 100644 --- a/src/scripting/ruby/ruby.c +++ b/src/scripting/ruby/ruby.c @@ -6,13 +6,14 @@ #include "elinks.h" +#include "intl/gettext/libintl.h" #include "main/module.h" #include "scripting/ruby/core.h" #include "scripting/ruby/hooks.h" struct module ruby_scripting_module = struct_module( - /* name: */ "Ruby", + /* name: */ N_("Ruby"), /* options: */ NULL, /* events: */ ruby_scripting_hooks, /* submodules: */ NULL, diff --git a/src/scripting/scripting.c b/src/scripting/scripting.c index 78ff5b9e..e214cdcc 100644 --- a/src/scripting/scripting.c +++ b/src/scripting/scripting.c @@ -41,7 +41,8 @@ report_scripting_error(struct module *module, struct session *ses, if (!ses) { if (list_empty(terminals)) { - usrerror("[%s error] %s", module->name, msg); + usrerror(gettext("[%s error] %s"), + gettext(module->name), msg); sleep(3); return; } @@ -57,7 +58,7 @@ report_scripting_error(struct module *module, struct session *ses, add_format_to_string(&string, _("An error occurred while running a %s script", term), - module->name); + _(module->name, term)); add_format_to_string(&string, ":\n\n%s", msg); diff --git a/src/scripting/smjs/core.c b/src/scripting/smjs/core.c index 7701d627..599c0096 100644 --- a/src/scripting/smjs/core.c +++ b/src/scripting/smjs/core.c @@ -113,7 +113,8 @@ smjs_load_hooks(void) assert(smjs_ctx); if (elinks_home) { - path = straconcat(elinks_home, SMJS_HOOKS_FILENAME, NULL); + path = straconcat(elinks_home, SMJS_HOOKS_FILENAME, + (unsigned char *) NULL); } else { path = stracpy(CONFDIR STRING_DIR_SEP SMJS_HOOKS_FILENAME); } diff --git a/src/scripting/smjs/globhist.c b/src/scripting/smjs/globhist.c index 6ea907d8..bcc4cad7 100644 --- a/src/scripting/smjs/globhist.c +++ b/src/scripting/smjs/globhist.c @@ -150,6 +150,7 @@ smjs_globhist_item_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval * case GLOBHIST_LAST_VISIT: { uint32 seconds; + /* Bug 923: Assumes time_t values fit in uint32. */ JS_ValueToECMAUint32(smjs_ctx, *vp, &seconds); history_item->last_visit = seconds; diff --git a/src/scripting/smjs/smjs.c b/src/scripting/smjs/smjs.c index 18221fe4..7bdab278 100644 --- a/src/scripting/smjs/smjs.c +++ b/src/scripting/smjs/smjs.c @@ -6,13 +6,14 @@ #include "elinks.h" +#include "intl/gettext/libintl.h" #include "main/module.h" #include "scripting/smjs/core.h" #include "scripting/smjs/hooks.h" struct module smjs_scripting_module = struct_module( - /* name: */ "Spidermonkey ECMAScript", + /* name: */ N_("Spidermonkey ECMAScript"), /* options: */ NULL, /* events: */ smjs_scripting_hooks, /* submodules: */ NULL, diff --git a/src/session/download.c b/src/session/download.c index 00ffbabb..a928bf2d 100644 --- a/src/session/download.c +++ b/src/session/download.c @@ -493,16 +493,20 @@ struct cdf_hop { }; static void -lun_alternate(struct lun_hop *lun_hop) +lun_alternate(void *lun_hop_) { + struct lun_hop *lun_hop = lun_hop_; + lun_hop->callback(lun_hop->term, lun_hop->file, lun_hop->data, 0); mem_free_if(lun_hop->ofile); mem_free(lun_hop); } static void -lun_cancel(struct lun_hop *lun_hop) +lun_cancel(void *lun_hop_) { + struct lun_hop *lun_hop = lun_hop_; + lun_hop->callback(lun_hop->term, NULL, lun_hop->data, 0); mem_free_if(lun_hop->ofile); mem_free_if(lun_hop->file); @@ -510,8 +514,10 @@ lun_cancel(struct lun_hop *lun_hop) } static void -lun_overwrite(struct lun_hop *lun_hop) +lun_overwrite(void *lun_hop_) { + struct lun_hop *lun_hop = lun_hop_; + lun_hop->callback(lun_hop->term, lun_hop->ofile, lun_hop->data, 0); mem_free_if(lun_hop->file); mem_free(lun_hop); @@ -520,8 +526,9 @@ lun_overwrite(struct lun_hop *lun_hop) static void common_download_do(struct terminal *term, int fd, void *data, int resume); static void -lun_resume(struct lun_hop *lun_hop) +lun_resume(void *lun_hop_) { + struct lun_hop *lun_hop = lun_hop_; struct cdf_hop *cdf_hop = lun_hop->data; int magic = *(int *)cdf_hop->data; @@ -631,10 +638,10 @@ lookup_unique_name(struct terminal *term, unsigned char *ofile, int resume, empty_string_or_(lun_hop->ofile), empty_string_or_(file)), lun_hop, 4, - N_("Sa~ve under the alternative name"), lun_alternate, B_ENTER, - N_("~Overwrite the original file"), lun_overwrite, 0, - N_("~Resume download of the original file"), lun_resume, 0, - N_("~Cancel"), lun_cancel, B_ESC); + MSG_BOX_BUTTON(N_("Sa~ve under the alternative name"), lun_alternate, B_ENTER), + MSG_BOX_BUTTON(N_("~Overwrite the original file"), lun_overwrite, 0), + MSG_BOX_BUTTON(N_("~Resume download of the original file"), lun_resume, 0), + MSG_BOX_BUTTON(N_("~Cancel"), lun_cancel, B_ESC)); } @@ -778,6 +785,9 @@ static unsigned char * subst_file(unsigned char *prog, unsigned char *file) { struct string name; + /* When there is no %s in the mailcap entry, the handler program reads + * data from stdin instead of a file. */ + int input = 1; if (!init_string(&name)) return NULL; @@ -790,6 +800,7 @@ subst_file(unsigned char *prog, unsigned char *file) prog += p; if (*prog == '%') { + input = 0; #if defined(HAVE_CYGWIN_CONV_TO_FULL_WIN32_PATH) #ifdef MAX_PATH unsigned char new_path[MAX_PATH]; @@ -806,6 +817,18 @@ subst_file(unsigned char *prog, unsigned char *file) } } + if (input) { + struct string s; + + if (init_string(&s)) { + add_to_string(&s, "/bin/cat "); + add_shell_quoted_to_string(&s, file, strlen(file)); + add_to_string(&s, " | "); + add_string_to_string(&s, &name); + done_string(&name); + return s.source; + } + } return name.source; } @@ -1245,7 +1268,7 @@ do_type_query(struct type_query *type_query, unsigned char *ct, struct mime_hand add_dlg_end(dlg, widgets); - ml = getml(dlg, NULL); + ml = getml(dlg, (void *) NULL); if (!ml) { /* XXX: Assume that the allocated @external_handler will be * freed when releasing the @type_query. */ @@ -1265,7 +1288,7 @@ do_type_query(struct type_query *type_query, unsigned char *ct, struct mime_hand struct { unsigned char *type; unsigned int plain:1; -} static known_types[] = { +} static const known_types[] = { { "text/html", 0 }, { "text/plain", 1 }, { "application/xhtml+xml", 0 }, /* RFC 3236 */ diff --git a/src/session/session.c b/src/session/session.c index 06377bc9..04d3f7c6 100644 --- a/src/session/session.c +++ b/src/session/session.c @@ -1,10 +1,5 @@ /* Sessions managment - you'll find things here which you wouldn't expect */ -/* stpcpy */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif - #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -775,7 +770,7 @@ setup_first_session(struct session *ses, struct uri *uri) if (!get_opt_bool("config.saving_style_w")) { struct option *opt = get_opt_rec(config_options, "config.saving_style_w"); opt->value.number = 1; - option_changed(ses, opt, opt); + option_changed(ses, opt); if (get_opt_int("config.saving_style") != 3) { info_box(term, 0, N_("Warning"), ALIGN_CENTER, @@ -809,7 +804,7 @@ setup_first_session(struct session *ses, struct uri *uri) "Press ESC for menu. Documentation is available in " "Help menu."), ses, 1, - N_("~OK"), handler, B_ENTER | B_ESC); + MSG_BOX_BUTTON(N_("~OK"), handler, B_ENTER | B_ESC)); /* If there is no URI the goto dialog will pop up so there is * no need to call setup_session(). */ @@ -1396,5 +1391,7 @@ eat_kbd_repeat_count(struct session *ses) ses->kbdprefix.repeat_count = 0; + /* Clear status bar when prefix is eaten (bug 930) */ + print_screen_status(ses); return count; } diff --git a/src/session/task.c b/src/session/task.c index 0595a846..14694b02 100644 --- a/src/session/task.c +++ b/src/session/task.c @@ -85,8 +85,10 @@ ses_load(struct session *ses, struct uri *uri, unsigned char *target_frame, } static void -post_yes(struct task *task) +post_yes(void *task_) { + struct task *task = task_; + abort_preloading(task->ses, 0); /* XXX: Make the session inherit the URI. */ @@ -96,8 +98,10 @@ post_yes(struct task *task) } static void -post_no(struct task *task) +post_no(void *task_) { + struct task *task = task_; + reload(task->ses, CACHE_MODE_NORMAL); done_uri(task->uri); } @@ -266,12 +270,12 @@ ses_goto(struct session *ses, struct uri *uri, unsigned char *target_frame, mem_free_if(uristring); } - msg_box(ses->tab->term, getml(task, NULL), MSGBOX_FREE_TEXT, + msg_box(ses->tab->term, getml(task, (void *) NULL), MSGBOX_FREE_TEXT, N_("Warning"), ALIGN_CENTER, message, task, 2, - N_("~Yes"), post_yes, B_ENTER, - N_("~No"), post_no, B_ESC); + MSG_BOX_BUTTON(N_("~Yes"), post_yes, B_ENTER), + MSG_BOX_BUTTON(N_("~No"), post_no, B_ESC)); } @@ -459,7 +463,7 @@ do_move(struct session *ses, struct download **download_p) struct cache_entry *cached; assert(download_p && *download_p); - assertm(ses->loading_uri, "no ses->loading_uri"); + assertm(ses->loading_uri != NULL, "no ses->loading_uri"); if_assert_failed return DO_MOVE_ABORT; if (ses->loading_uri->protocol == PROTOCOL_UNKNOWN) diff --git a/src/terminal/color.c b/src/terminal/color.c index f9c09b81..8112628d 100644 --- a/src/terminal/color.c +++ b/src/terminal/color.c @@ -25,7 +25,7 @@ struct rgb_cache_entry { }; static inline int -color_distance(struct rgb *c1, struct rgb *c2) +color_distance(const struct rgb *c1, const struct rgb *c2) { int r = c1->r - c2->r; int g = c1->g - c2->g; @@ -57,7 +57,7 @@ color_distance(struct rgb *c1, struct rgb *c2) /* Locates the nearest terminal color. */ static inline unsigned char -get_color(color_T color, struct rgb *palette, int level) +get_color(color_T color, const struct rgb *palette, int level) { static struct rgb_cache_entry cache[RGB_HASH_SIZE]; struct rgb_cache_entry *rgb_cache = &cache[HASH_RGB(color, level)]; @@ -120,7 +120,7 @@ enum palette_range { }; struct color_mode_info { - struct rgb *palette; + const struct rgb *palette; struct { int bg; @@ -128,7 +128,7 @@ struct color_mode_info { } palette_range[PALETTE_RANGES]; }; -static struct color_mode_info color_mode_16 = { +static const struct color_mode_info color_mode_16 = { palette16, { /* PALETTE_FULL */ { 8, 16 }, @@ -137,7 +137,7 @@ static struct color_mode_info color_mode_16 = { }; #ifdef CONFIG_88_COLORS -static struct color_mode_info color_mode_88 = { +static const struct color_mode_info color_mode_88 = { palette88, { /* PALETTE_FULL */ { 88, 88 }, @@ -147,7 +147,7 @@ static struct color_mode_info color_mode_88 = { #endif #ifdef CONFIG_256_COLORS -static struct color_mode_info color_mode_256 = { +static const struct color_mode_info color_mode_256 = { palette256, { /* PALETTE_FULL */ { 256, 256 }, @@ -156,16 +156,27 @@ static struct color_mode_info color_mode_256 = { }; #endif -static struct color_mode_info *color_modes[] = { +static const struct color_mode_info *const color_modes[] = { /* COLOR_MODE_MONO */ &color_mode_16, /* COLOR_MODE_16 */ &color_mode_16, #ifdef CONFIG_88_COLORS /* COLOR_MODE_88 */ &color_mode_88, +#else + /* COLOR_MODE_88 */ &color_mode_16, #endif #ifdef CONFIG_256_COLORS /* COLOR_MODE_256 */ &color_mode_256, +#else + /* COLOR_MODE_256 */ &color_mode_16, #endif + /* @set_term_color reads @color_modes[COLOR_MODE_TRUE_COLOR] + * only if CONFIG_TRUE_COLOR is not defined. */ + /* COLOR_MODE_TRUE_COLOR */ &color_mode_16, }; +/* Get a compile-time error if the array has the wrong size. */ +typedef int assert_enough_color_modes[ + (sizeof(color_modes) / sizeof(color_modes[0]) == COLOR_MODES) + ? 1 : -1]; /* Colors values used in the foreground color table: * @@ -183,7 +194,7 @@ static struct color_mode_info *color_modes[] = { /* This table is based mostly on wild guesses of mine. Feel free to * correct it. --pasky */ /* Indexed by [fg][bg]->fg: */ -static unsigned char fg_color[16][8] = { +static const unsigned char fg_color[16][8] = { /* bk r gr br bl m c w */ /* 0 (black) */ @@ -276,7 +287,7 @@ void set_term_color(struct screen_char *schar, struct color_pair *pair, enum color_flags flags, enum color_mode color_mode) { - struct color_mode_info *mode; + const struct color_mode_info *mode; enum palette_range palette_range = PALETTE_FULL; unsigned char fg, bg; @@ -301,6 +312,9 @@ set_term_color(struct screen_char *schar, struct color_pair *pair, } break; + default: + /* If the desired color mode was not compiled in, + * use 16 colors. */ case COLOR_MODE_16: /* Decrease the range of the 16 palette to not include * bright colors. */ @@ -315,7 +329,7 @@ set_term_color(struct screen_char *schar, struct color_pair *pair, case COLOR_MODE_256: #endif /* TODO: Handle decrease lightness by converting to - * hue-ligthness-saturation color model */ + * hue-lightness-saturation color model */ break; #endif #ifdef CONFIG_TRUE_COLOR @@ -386,6 +400,9 @@ set_term_color(struct screen_char *schar, struct color_pair *pair, case COLOR_MODE_TRUE_COLOR: return; #endif + default: + /* If the desired color mode was not compiled in, + * use 16 colors. */ case COLOR_MODE_MONO: case COLOR_MODE_16: set_term_color16(schar, flags, fg, bg); diff --git a/src/terminal/color.h b/src/terminal/color.h index a5d88ef7..5ab55bb8 100644 --- a/src/terminal/color.h +++ b/src/terminal/color.h @@ -40,20 +40,26 @@ enum color_flags { COLOR_ENSURE_INVERTED_CONTRAST = 16, }; +/* These numbers are used in the terminal._template_.colors and + * document.dump.color_mode options. They should be kept stable so + * that configuration files are portable between ELinks versions. + * Any unsupported modes should be treated as COLOR_MODE_16. + * (Can't fall back to COLOR_MODE_88 from COLOR_MODE_256 because + * the palettes are incompatible.) */ enum color_mode { COLOR_MODE_DUMP = -1, - COLOR_MODE_MONO, - COLOR_MODE_16, + COLOR_MODE_MONO = 0, + COLOR_MODE_16 = 1, #ifdef CONFIG_88_COLORS - COLOR_MODE_88, + COLOR_MODE_88 = 2, #endif #ifdef CONFIG_256_COLORS - COLOR_MODE_256, + COLOR_MODE_256 = 3, #endif #ifdef CONFIG_TRUE_COLOR - COLOR_MODE_TRUE_COLOR, + COLOR_MODE_TRUE_COLOR = 4, #endif - COLOR_MODES, /* XXX: Keep last */ + COLOR_MODES = 5, /* XXX: Keep last */ }; inline void set_term_color16(struct screen_char *schar, enum color_flags flags, diff --git a/src/terminal/draw.c b/src/terminal/draw.c index 5e81e2b7..cf72dbff 100644 --- a/src/terminal/draw.c +++ b/src/terminal/draw.c @@ -46,7 +46,7 @@ void draw_border_cross(struct terminal *term, int x, int y, enum border_cross_direction dir, struct color_pair *color) { - static unsigned char border_trans[2][4] = { + static const unsigned char border_trans[2][4] = { /* Used for BORDER_X_{RIGHT,LEFT}: */ { BORDER_SVLINE, BORDER_SRTEE, BORDER_SLTEE }, /* Used for BORDER_X_{DOWN,UP}: */ @@ -155,7 +155,7 @@ draw_line(struct terminal *term, int x, int y, int l, struct screen_char *line) if (term->utf8) { struct screen_char *sc; - if (line->data == UCS_NO_CHAR && x == 0) { + if (line[0].data == UCS_NO_CHAR && x == 0) { unicode_val_T data_save; sc = line; @@ -191,7 +191,7 @@ void draw_border(struct terminal *term, struct box *box, struct color_pair *color, int width) { - static enum border_char p1[] = { + static const enum border_char p1[] = { BORDER_SULCORNER, BORDER_SURCORNER, BORDER_SDLCORNER, @@ -199,7 +199,7 @@ draw_border(struct terminal *term, struct box *box, BORDER_SVLINE, BORDER_SHLINE, }; - static enum border_char p2[] = { + static const enum border_char p2[] = { BORDER_DULCORNER, BORDER_DURCORNER, BORDER_DDLCORNER, @@ -207,7 +207,7 @@ draw_border(struct terminal *term, struct box *box, BORDER_DVLINE, BORDER_DHLINE, }; - enum border_char *p = (width > 1) ? p2 : p1; + const enum border_char *p = (width > 1) ? p2 : p1; struct box borderbox; set_box(&borderbox, box->x - 1, box->y - 1, diff --git a/src/terminal/draw.h b/src/terminal/draw.h index c5fdfbcc..7d3927cf 100644 --- a/src/terminal/draw.h +++ b/src/terminal/draw.h @@ -31,6 +31,8 @@ enum screen_char_attr { /* One position in the terminal screen's image. */ struct screen_char { /* Contains either character value or frame data. + * If @attr includes SCREEN_ATTR_FRAME, then @data is enum + * border_char; otherwise, @data is a character value. * If CONFIG_UTF8 is defined, and UTF-8 I/O is enabled for the * terminal, then the character value is in UCS-4; otherwise, * it is in the charset of the terminal, and the charset is diff --git a/src/terminal/event.c b/src/terminal/event.c index 49913aab..237ff5b2 100644 --- a/src/terminal/event.c +++ b/src/terminal/event.c @@ -124,7 +124,7 @@ term_send_event(struct terminal *term, struct term_event *ev) win = term->windows.next; if (win->type == WINDOW_TAB) { win = get_current_tab(term); - assertm(win, "No tab to send the event to!"); + assertm(win != NULL, "No tab to send the event to!"); if_assert_failed return; } @@ -143,7 +143,7 @@ term_send_ucs(struct terminal *term, unicode_val_T u, term_send_event(term, &ev); #else /* !CONFIG_UTF8 */ struct term_event ev; - unsigned char *recoded; + const unsigned char *recoded; set_kbd_term_event(&ev, KBD_UNDEF, modifier); recoded = u2cp_no_nbsp(u, get_opt_codepage_tree(term->spec, "charset")); diff --git a/src/terminal/kbd.c b/src/terminal/kbd.c index eb6e1ae6..16be876b 100644 --- a/src/terminal/kbd.c +++ b/src/terminal/kbd.c @@ -350,13 +350,13 @@ unblock_itrm_x(void *h) { close_handle(h); if (!ditrm) return; - unblock_itrm(0); + unblock_itrm(); resize_terminal(); } int -unblock_itrm(int fd) +unblock_itrm(void) { if (!ditrm) return -1; @@ -375,7 +375,7 @@ unblock_itrm(int fd) void -block_itrm(int fd) +block_itrm(void) { if (!ditrm) return; @@ -591,7 +591,7 @@ has_nul_byte: memcpy(param + 1, path.source, path_len + 1); memcpy(param + 1 + path_len + 1, delete.source, del_len + 1); - if (fg == 1) block_itrm(itrm->in.ctl); + if (fg == 1) block_itrm(); blockh = start_thread((void (*)(void *, int)) exec_thread, param, param_len); @@ -599,7 +599,7 @@ has_nul_byte: if (blockh == -1) { if (fg == 1) - unblock_itrm(itrm->in.ctl); + unblock_itrm(); goto nasty_thing; } diff --git a/src/terminal/kbd.h b/src/terminal/kbd.h index 89d352b2..f5b6d879 100644 --- a/src/terminal/kbd.h +++ b/src/terminal/kbd.h @@ -118,8 +118,8 @@ handle_trm(int std_in, int std_out, int sock_in, int sock_out, int ctl_in, void *init_string, int init_len, int remote); void itrm_queue_event(struct itrm *itrm, unsigned char *data, int len); -void block_itrm(int); -int unblock_itrm(int); +void block_itrm(void); +int unblock_itrm(void); void free_all_itrms(void); void resize_terminal(void); void dispatch_special(unsigned char *); diff --git a/src/terminal/palette.inc b/src/terminal/palette.inc index edc4a5b0..610822f8 100644 --- a/src/terminal/palette.inc +++ b/src/terminal/palette.inc @@ -2,7 +2,7 @@ /* TODO: We should probably autogenerate this using xterm's perl script. */ /* The 16 ANSI colors. */ -static struct rgb palette16[] = { +static const struct rgb palette16[] = { #if defined(PALA) {0x00, 0x00, 0x00}, {0x80, 0x00, 0x00}, @@ -59,10 +59,10 @@ static struct rgb palette16[] = { #ifdef CONFIG_88_COLORS /* Regexp'd from Dickey's xterm 88colres.h file. */ -/* Colors 0-16 are the ANSI colors (and the same as palette16[]). - * Colors 16-79 are 4x4x4 color cubes +/* Colors 0-15 are the ANSI colors (and the same as palette16[]). + * Colors 16-79 are a 4x4x4 color cube * Colors 80-91 are a grayscale ramp (with black and white left out). */ -static struct rgb palette88[] = { +static const struct rgb palette88[] = { {0x00, 0x00, 0x00}, /* 0 */ {0x80, 0x00, 0x00}, /* 1 */ {0x00, 0x80, 0x00}, /* 2 */ @@ -161,26 +161,55 @@ static struct rgb palette88[] = { #ifdef CONFIG_256_COLORS /* Regexp'd from Dickey's xterm 256colres.h file. */ -/* Colors 0- 16 are the ANSI colors (and the same as palette16[]). +/* Colors 0- 15 are the ANSI colors (from xterm-215/XTerm-col.ad + * and Xorg's rgb.txt, not the same as palette16[]). * Colors 16-231 are a 6x6x6 color cube - * Colors 231-255 are a grayscale ramp (with black and white left out). */ -static struct rgb palette256[] = { - {0x00, 0x00, 0x00}, /* 0 */ - {0x80, 0x00, 0x00}, /* 1 */ - {0x00, 0x80, 0x00}, /* 2 */ - {0xaa, 0x55, 0x00}, /* 3 */ - {0x00, 0x00, 0x80}, /* 4 */ - {0x80, 0x00, 0x80}, /* 5 */ - {0x00, 0x80, 0x80}, /* 6 */ - {0xaa, 0xaa, 0xaa}, /* 7 */ - {0x55, 0x55, 0x55}, /* 8 */ - {0xff, 0x55, 0x55}, /* 9 */ - {0x55, 0xff, 0x55}, /* 10 */ - {0xff, 0xff, 0x55}, /* 11 */ - {0x55, 0x55, 0xff}, /* 12 */ - {0xff, 0x55, 0xff}, /* 13 */ - {0x55, 0xff, 0xff}, /* 14 */ - {0xff, 0xff, 0xff}, /* 15 */ + * Colors 232-255 are a grayscale ramp (with black and white left out). + * + * The 6x6x6 color cube of xterm uses brightnesses 00-5f-87-af-d7-ff + * whereas the "web-safe" palette uses 00-33-66-99-cc-ff, which then + * becomes 00-5f-5f-87-d7-ff when ELinks finds the nearest available + * color. If it is important to preserve distinctions between + * "web-safe" colors, you can alter the 6x6x6 cube in palette256[] to + * make ELinks imagine the brightnesses are 00-33-66-99-cc-ff, so that + * the "web-safe" colors then fall directly on it. If you do this, + * you should also change the other entries of palette256[] in a + * similar way, to keep the brightnesses in the correct order. You + * could for instance interpolate the brightnesses with the following + * function, which passes through all six points and has a continuous + * positive first derivative: + * + * y = (765/11) - sqrt(585225/121 - (2601/55)*x) when x <= 0x5f + * x = (-55/2601)*y^2 + (150/51)*y when x <= 0x5f + * y = (51/40)*x + (-561/8) when x >= 0x5f + * + * If you use Emacs then here is how to do it easily: + * + * (while (re-search-forward "0x\\([[:xdigit:]]+\\)" nil t) + (let* ((x (string-to-number (match-string 1) 16)) + (y (if (<= x #x5f) + (- (/ 765.0 11.0) + (sqrt (- (/ 585225.0 121.0) (* (/ 2601.0 55.0) x)))) + (+ (* (/ 51.0 40.0) x) (/ -561.0 8.0))))) + (replace-match (format "%.2x" (round y)) nil t nil 1))) + */ +static const struct rgb palette256[] = { + {0x00, 0x00, 0x00}, /* 0 black */ + {0xcd, 0x00, 0x00}, /* 1 red3 */ + {0x00, 0xcd, 0x00}, /* 2 green3 */ + {0xcd, 0xcd, 0x00}, /* 3 yellow3 */ + {0x00, 0x00, 0xee}, /* 4 blue2 */ + {0xcd, 0x00, 0xcd}, /* 5 magenta3 */ + {0x00, 0xcd, 0xcd}, /* 6 cyan3 */ + {0xe5, 0xe5, 0xe5}, /* 7 gray90 */ + {0x7f, 0x7f, 0x7f}, /* 8 gray50 */ + {0xff, 0x00, 0x00}, /* 9 red */ + {0x00, 0xff, 0x00}, /* 10 green */ + {0xff, 0xff, 0x00}, /* 11 yellow */ + {0x5c, 0x5c, 0xff}, /* 12 rgb:5c/5c/ff */ + {0xff, 0x00, 0xff}, /* 13 magenta */ + {0x00, 0xff, 0xff}, /* 14 cyan */ + {0xff, 0xff, 0xff}, /* 15 white */ {0x00, 0x00, 0x00}, /* 16 */ {0x00, 0x00, 0x5f}, /* 17 */ diff --git a/src/terminal/screen.c b/src/terminal/screen.c index 1f5e0ca0..0c762fa3 100644 --- a/src/terminal/screen.c +++ b/src/terminal/screen.c @@ -28,12 +28,12 @@ /* TODO: We must use termcap/terminfo if available! --pasky */ -unsigned char frame_dumb[48] = " ||||++||++++++--|-+||++--|-+----++++++++ "; -static unsigned char frame_vt100[48] = "aaaxuuukkuxkjjjkmvwtqnttmlvwtqnvvwwmmllnnjla "; +const unsigned char frame_dumb[48] = " ||||++||++++++--|-+||++--|-+----++++++++ "; +static const unsigned char frame_vt100[48] = "aaaxuuukkuxkjjjkmvwtqnttmlvwtqnvvwwmmllnnjla "; #ifndef CONFIG_UTF8 /* For UTF8 I/O */ -static unsigned char frame_vt100_u[48] = { +static const unsigned char frame_vt100_u[48] = { 177, 177, 177, 179, 180, 180, 180, 191, 191, 180, 179, 191, 217, 217, 217, 191, 192, 193, 194, 195, 196, 197, 195, 195, @@ -43,7 +43,7 @@ static unsigned char frame_vt100_u[48] = { }; #endif /* CONFIG_UTF8 */ -static unsigned char frame_freebsd[48] = { +static const unsigned char frame_freebsd[48] = { 130, 138, 128, 153, 150, 150, 150, 140, 140, 150, 153, 140, 139, 139, 139, 140, 142, 151, 152, 149, 146, 143, 149, 149, @@ -52,7 +52,7 @@ static unsigned char frame_freebsd[48] = { 143, 139, 141, 128, 128, 128, 128, 128, }; -static unsigned char frame_koi[48] = { +static const unsigned char frame_koi[48] = { 144, 145, 146, 129, 135, 178, 180, 167, 166, 181, 161, 168, 174, 173, 172, 131, 132, 137, 136, 134, 128, 138, 175, 176, @@ -62,7 +62,7 @@ static unsigned char frame_koi[48] = { }; /* Most of this table is just 176 + . */ -static unsigned char frame_restrict[48] = { +static const unsigned char frame_restrict[48] = { 176, 177, 178, 179, 180, 179, 186, 186, 205, 185, 186, 187, 188, 186, 205, 191, 192, 193, 194, 195, 196, 197, 179, 186, @@ -73,27 +73,28 @@ static unsigned char frame_restrict[48] = { #define TERM_STRING(str) INIT_STRING(str, sizeof(str) - 1) +/* Like add_string_to_string but has fewer checks to slow it down. */ #define add_term_string(str, tstr) \ add_bytes_to_string(str, (tstr).source, (tstr).length) -static struct string m11_hack_frame_seqs[] = { +static const struct string m11_hack_frame_seqs[] = { /* end border: */ TERM_STRING("\033[10m"), /* begin border: */ TERM_STRING("\033[11m"), }; #ifdef CONFIG_UTF8 -static struct string utf8_linux_frame_seqs[] = { +static const struct string utf8_linux_frame_seqs[] = { /* end border: */ TERM_STRING("\033[10m\033%G"), /* begin border: */ TERM_STRING("\033%@\033[11m"), }; #endif /* CONFIG_UTF8 */ -static struct string vt100_frame_seqs[] = { +static const struct string vt100_frame_seqs[] = { /* end border: */ TERM_STRING("\x0f"), /* begin border: */ TERM_STRING("\x0e"), }; -static struct string underline_seqs[] = { +static const struct string underline_seqs[] = { /* begin underline: */ TERM_STRING("\033[24m"), /* end underline: */ TERM_STRING("\033[4m"), }; @@ -112,18 +113,18 @@ struct screen_driver { #ifndef CONFIG_UTF8 /* Charsets when doing UTF8 I/O. */ /* [0] is the common charset and [1] is the frame charset. - * Test wether to use UTF8 I/O using the use_utf8_io() macro. */ + * Test whether to use UTF8 I/O using the use_utf8_io() macro. */ int charsets[2]; #endif /* CONFIG_UTF8 */ /* The frame translation table. May be NULL. */ - unsigned char *frame; + const unsigned char *frame; /* The frame mode setup and teardown sequences. May be NULL. */ - struct string *frame_seqs; + const struct string *frame_seqs; /* The underline mode setup and teardown sequences. May be NULL. */ - struct string *underline; + const struct string *underline; /* The color mode */ enum color_mode color_mode; @@ -140,7 +141,7 @@ struct screen_driver { unsigned char name[1]; /* XXX: Keep last! */ }; -static struct screen_driver dumb_screen_driver = { +static const struct screen_driver dumb_screen_driver = { NULL_LIST_HEAD, /* type: */ TERM_DUMB, #ifndef CONFIG_UTF8 @@ -156,7 +157,7 @@ static struct screen_driver dumb_screen_driver = { #endif /* CONFIG_UTF8 */ }; -static struct screen_driver vt100_screen_driver = { +static const struct screen_driver vt100_screen_driver = { NULL_LIST_HEAD, /* type: */ TERM_VT100, #ifndef CONFIG_UTF8 @@ -172,7 +173,7 @@ static struct screen_driver vt100_screen_driver = { #endif /* CONFIG_UTF8 */ }; -static struct screen_driver linux_screen_driver = { +static const struct screen_driver linux_screen_driver = { NULL_LIST_HEAD, /* type: */ TERM_LINUX, #ifndef CONFIG_UTF8 @@ -188,7 +189,7 @@ static struct screen_driver linux_screen_driver = { #endif /* CONFIG_UTF8 */ }; -static struct screen_driver koi8_screen_driver = { +static const struct screen_driver koi8_screen_driver = { NULL_LIST_HEAD, /* type: */ TERM_KOI8, #ifndef CONFIG_UTF8 @@ -204,7 +205,7 @@ static struct screen_driver koi8_screen_driver = { #endif /* CONFIG_UTF8 */ }; -static struct screen_driver freebsd_screen_driver = { +static const struct screen_driver freebsd_screen_driver = { NULL_LIST_HEAD, /* type: */ TERM_FREEBSD, #ifndef CONFIG_UTF8 @@ -221,7 +222,7 @@ static struct screen_driver freebsd_screen_driver = { }; /* XXX: Keep in sync with enum term_mode_type. */ -static struct screen_driver *screen_drivers[] = { +static const struct screen_driver *const screen_drivers[] = { /* TERM_DUMB: */ &dumb_screen_driver, /* TERM_VT100: */ &vt100_screen_driver, /* TERM_LINUX: */ &linux_screen_driver, @@ -532,10 +533,19 @@ add_char_data(struct string *screen, struct screen_driver *driver, unsigned char data, unsigned char border) #endif /* CONFIG_UTF8 */ { - if (!isscreensafe(data)) { - add_char_to_string(screen, ' '); - return; - } + /* CONFIG_UTF8 use_utf8_io border data add_to_string + * ----------- ----------- ------ ---------------- ---------------- + * not defined 0 0 terminal unibyte terminal unibyte + * not defined 0 1 enum border_char border unibyte + * not defined 1 0 terminal unibyte UTF-8 + * not defined 1 1 enum border_char UTF-8 + * defined 0 0 terminal unibyte terminal unibyte + * defined 0 1 enum border_char border unibyte + * defined 1 0 UTF-32 UTF-8 + * defined 1 1 enum border_char border unibyte + * + * For "UTF-32" above, the data can also be UCS_NO_CHAR. + */ if (border && driver->frame && data >= 176 && data < 224) data = driver->frame[data - 176]; @@ -544,18 +554,25 @@ add_char_data(struct string *screen, struct screen_driver *driver, #ifdef CONFIG_UTF8 if (border) add_char_to_string(screen, (unsigned char)data); - else - if (data != UCS_NO_CHAR) - add_to_string(screen, encode_utf8(data)); + else if (data != UCS_NO_CHAR) { + if (!isscreensafe_ucs(data)) + data = UCS_SPACE; + add_to_string(screen, encode_utf8(data)); + } #else int charset = driver->charsets[!!border]; - add_to_string(screen, cp2utf8(charset, data)); + if (border || isscreensafe(data)) + add_to_string(screen, cp2utf8(charset, data)); + else /* UCS_SPACE <= 0x7F and so fits in one UTF-8 byte */ + add_char_to_string(screen, UCS_SPACE); #endif /* CONFIG_UTF8 */ - return; + } else { + if (border || isscreensafe(data)) + add_char_to_string(screen, (unsigned char)data); + else + add_char_to_string(screen, ' '); } - - add_char_to_string(screen, (unsigned char)data); } /* Time critical section. */ @@ -612,7 +629,15 @@ add_char16(struct string *screen, struct screen_driver *driver, add_bytes_to_string(screen, "\033[0", 3); - if (driver->color_mode == COLOR_MODE_16) { + /* @update_screen_driver has set @driver->color_mode + * according to terminal-type-specific options. + * The caller of @add_char16 has already partially + * checked it, but there are still these possibilities: + * - COLOR_MODE_MONO. Then don't show colors, but + * perhaps use the standout attribute. + * - COLOR_MODE_16. Use 16 colors. + * - An unsupported color mode. Use 16 colors. */ + if (driver->color_mode != COLOR_MODE_MONO) { unsigned char code[6] = ";30;40"; unsigned char bgcolor = TERM_COLOR_BACKGROUND_16(ch->color); @@ -647,13 +672,13 @@ add_char16(struct string *screen, struct screen_driver *driver, } #if defined(CONFIG_88_COLORS) || defined(CONFIG_256_COLORS) -static struct string color256_seqs[] = { +static const struct string color256_seqs[] = { /* foreground: */ TERM_STRING("\033[0;38;5;%dm"), /* background: */ TERM_STRING("\033[48;5;%dm"), }; static inline void -add_char_color(struct string *screen, struct string *seq, unsigned char color) +add_char_color(struct string *screen, const struct string *seq, unsigned char color) { unsigned char color_buf[3]; unsigned char *color_pos = color_buf; @@ -764,14 +789,14 @@ add_char256(struct string *screen, struct screen_driver *driver, #endif #ifdef CONFIG_TRUE_COLOR -static struct string color_true_seqs[] = { +static const struct string color_true_seqs[] = { /* foreground: */ TERM_STRING("\033[0;38;2"), /* background: */ TERM_STRING("\033[48;2"), }; #define add_true_background_color(str, seq, chr) add_char_true_color(str, &(seq)[1], &(chr)->color[3]) #define add_true_foreground_color(str, seq, chr) add_char_true_color(str, &(seq)[0], &(chr)->color[0]) static inline void -add_char_true_color(struct string *screen, struct string *seq, unsigned char *colors) +add_char_true_color(struct string *screen, const struct string *seq, unsigned char *colors) { unsigned char color_buf[3]; int i; @@ -956,6 +981,9 @@ redraw_screen(struct terminal *term) if (!init_string(&image)) return; switch (driver->color_mode) { + default: + /* If the desired color mode was not compiled in, + * use 16 colors. */ case COLOR_MODE_MONO: case COLOR_MODE_16: add_chars(&image, term, driver, &state, add_char16, compare_bg_color_16, compare_fg_color_16); @@ -977,13 +1005,12 @@ redraw_screen(struct terminal *term) #endif case COLOR_MODES: case COLOR_MODE_DUMP: - default: INTERNAL("Invalid color mode (%d).", driver->color_mode); return; } if (image.length) { - if (driver->color_mode) + if (driver->color_mode != COLOR_MODE_MONO) add_bytes_to_string(&image, "\033[37;40m", 8); add_bytes_to_string(&image, "\033[0m", 4); @@ -1098,6 +1125,10 @@ done_screen(struct terminal_screen *screen) } struct module terminal_screen_module = struct_module( + /* Because this module is a submodule of terminal_module, + * which is listed main_modules rather than in builtin_modules, + * its name does not appear in the user interface and + * so need not be translatable. */ /* name: */ "Terminal Screen", /* options: */ NULL, /* hooks: */ NULL, diff --git a/src/terminal/tab.c b/src/terminal/tab.c index 24ac7579..8aaf8a38 100644 --- a/src/terminal/tab.c +++ b/src/terminal/tab.c @@ -169,8 +169,9 @@ switch_current_tab(struct session *ses, int direction) } static void -really_close_tab(struct session *ses) +really_close_tab(void *ses_) { + struct session *ses = ses_; struct terminal *term = ses->tab->term; struct window *current_tab = get_current_tab(term); @@ -203,13 +204,14 @@ close_tab(struct terminal *term, struct session *ses) N_("Close tab"), ALIGN_CENTER, N_("Do you really want to close the current tab?"), ses, 2, - N_("~Yes"), (void (*)(void *)) really_close_tab, B_ENTER, - N_("~No"), NULL, B_ESC); + MSG_BOX_BUTTON(N_("~Yes"), really_close_tab, B_ENTER), + MSG_BOX_BUTTON(N_("~No"), NULL, B_ESC)); } static void -really_close_tabs(struct session *ses) +really_close_tabs(void *ses_) { + struct session *ses = ses_; struct terminal *term = ses->tab->term; struct window *current_tab = get_current_tab(term); struct window *tab; @@ -246,8 +248,8 @@ close_all_tabs_but_current(struct session *ses) N_("Close tab"), ALIGN_CENTER, N_("Do you really want to close all except the current tab?"), ses, 2, - N_("~Yes"), (void (*)(void *)) really_close_tabs, B_ENTER, - N_("~No"), NULL, B_ESC); + MSG_BOX_BUTTON(N_("~Yes"), really_close_tabs, B_ENTER), + MSG_BOX_BUTTON(N_("~No"), NULL, B_ESC)); } diff --git a/src/terminal/terminal.c b/src/terminal/terminal.c index 265f9381..befaa0a1 100644 --- a/src/terminal/terminal.c +++ b/src/terminal/terminal.c @@ -16,7 +16,6 @@ #include "bookmarks/bookmarks.h" #include "config/options.h" -#include "intl/gettext/libintl.h" #include "main/main.h" #include "main/module.h" #include "main/object.h" @@ -41,28 +40,6 @@ INIT_LIST_HEAD(terminals); static void check_if_no_terminal(void); -#if 0 -static int -was_utf8(int in, int out) -{ - /* Taken from setedit. - * Set cursor in the up left corner. Write "\357\200\240" == U+F020. - * Read cursor position. For UTF-8 x will be 2. - * For normal mode it will be 4. */ - static unsigned char *str = "\033[1;1H\357\200\240\033[6n"; - unsigned char buf[20]; - int x, y; - - hard_write(out, str, strlen(str)); - buf[0] = '\0'; - read(in, buf, 6); - if (sscanf(buf,"\033[%d;%dR",&y,&x)==2) { - if (x > 2) return 0; - } - return 1; -} -#endif - void redraw_terminal(struct terminal *term) { @@ -118,13 +95,6 @@ init_term(int fdin, int fdout) term->spec = get_opt_rec(config_options, name); object_lock(term->spec); -#if 0 - /* The hack to restore console in the right mode */ - if (get_opt_int_tree(term->spec, "type") == TERM_LINUX) { - term->linux_was_utf8 = was_utf8(get_input_handle(), term->fdout); - } -#endif - add_to_list(terminals, term); set_handlers(fdin, (select_handler_T) in_term, NULL, @@ -172,17 +142,6 @@ destroy_terminal(struct terminal *term) del_from_list(term); close(term->fdin); -#if 0 - /* This code doesn't work with slave terminals. */ - if (get_opt_int_tree(term->spec, "type") == TERM_LINUX) { - if (term->linux_was_utf8) { - hard_write(term->fdout, "\033%G", 3); - } else { - hard_write(term->fdout, "\033%@", 3); - } - } -#endif - if (term->fdout != 1) { if (term->fdout != term->fdin) close(term->fdout); } else { @@ -240,7 +199,7 @@ unblock_terminal(struct terminal *term) term->blocked = -1; set_handlers(term->fdin, (select_handler_T) in_term, NULL, (select_handler_T) destroy_terminal, term); - unblock_itrm(term->fdin); + unblock_itrm(); redraw_terminal_cls(term); if (textarea_editor) /* XXX */ textarea_edit(1, NULL, NULL, NULL, NULL); @@ -263,13 +222,13 @@ exec_on_master_terminal(struct terminal *term, memcpy(param + 1, path, plen + 1); memcpy(param + 1 + plen + 1, delete, dlen + 1); - if (fg == 1) block_itrm(term->fdin); + if (fg == 1) block_itrm(); blockh = start_thread((void (*)(void *, int)) exec_thread, param, param_size); fmem_free(param); if (blockh == -1) { - if (fg == 1) unblock_itrm(term->fdin); + if (fg == 1) unblock_itrm(); return; } @@ -420,6 +379,9 @@ static struct module *terminal_submodules[] = { }; struct module terminal_module = struct_module( + /* Because this module is listed in main_modules rather than + * in builtin_modules, its name does not appear in the user + * interface and so need not be translatable. */ /* name: */ "Terminal", /* options: */ NULL, /* hooks: */ NULL, diff --git a/src/terminal/terminal.h b/src/terminal/terminal.h index 9a609aac..ee92de9b 100644 --- a/src/terminal/terminal.h +++ b/src/terminal/terminal.h @@ -132,9 +132,6 @@ struct terminal { unsigned int utf8:1; #endif /* CONFIG_UTF8 */ - /* Indicates whether Linux console was in UTF-8 mode on startup */ - unsigned int linux_was_utf8:1; - /* The current tab number. */ int current_tab; @@ -162,7 +159,7 @@ struct terminal { extern struct list_head terminals; -extern unsigned char frame_dumb[]; +extern const unsigned char frame_dumb[]; struct terminal *init_term(int, int); void destroy_terminal(struct terminal *); diff --git a/src/util/color.c b/src/util/color.c index 92abadb1..8aa0b01c 100644 --- a/src/util/color.c +++ b/src/util/color.c @@ -18,11 +18,11 @@ #include "util/string.h" struct color_spec { - char *name; + const char *name; color_T rgb; }; -static struct color_spec color_specs[] = { +static const struct color_spec color_specs[] = { #include "util/color_s.inc" #ifndef CONFIG_SMALL #include "util/color.inc" @@ -32,7 +32,7 @@ static struct color_spec color_specs[] = { #ifdef USE_FASTFIND -static struct color_spec *internal_pointer; +static const struct color_spec *internal_pointer; static void colors_list_reset(void) @@ -52,7 +52,7 @@ colors_list_next(void) if (!internal_pointer->name) return NULL; kv.key = (unsigned char *) internal_pointer->name; - kv.data = internal_pointer; + kv.data = (void *) internal_pointer; /* cast away const */ internal_pointer++; @@ -107,7 +107,7 @@ decode_hex_color: return 0; } } else { - struct color_spec *cs; + const struct color_spec *cs; #ifndef USE_FASTFIND for (cs = color_specs; cs->name; cs++) @@ -135,10 +135,10 @@ decode_hex_color: return -1; /* Not found */ } -unsigned char * +const unsigned char * get_color_string(color_T color, unsigned char hexcolor[8]) { - struct color_spec *cs; + const struct color_spec *cs; for (cs = color_specs; cs->name; cs++) if (cs->rgb == color) diff --git a/src/util/color.h b/src/util/color.h index 5e0240c8..7fb6c46e 100644 --- a/src/util/color.h +++ b/src/util/color.h @@ -17,7 +17,7 @@ int decode_color(unsigned char *str, int slen, color_T *color); /* Returns a string containing the color info. If no ``English'' name can be * found the hex color (#rrggbb) is returned in the given buffer. */ -unsigned char *get_color_string(color_T color, unsigned char hexcolor[8]); +const unsigned char *get_color_string(color_T color, unsigned char hexcolor[8]); /* Translate rgb color to string in #rrggbb format. str should be a pointer to * a 8 bytes memory space. */ diff --git a/src/util/conv.c b/src/util/conv.c index 248f52dd..13c27f69 100644 --- a/src/util/conv.c +++ b/src/util/conv.c @@ -52,9 +52,9 @@ elinks_ulongcat(unsigned char *s, unsigned int *slen, unsigned char fillchar, unsigned int base, unsigned int upper) { - static unsigned char unum[]= "0123456789ABCDEF"; - static unsigned char lnum[]= "0123456789abcdef"; - unsigned char *to_num = (unsigned char *) (upper ? &unum : &lnum); + static const unsigned char unum[]= "0123456789ABCDEF"; + static const unsigned char lnum[]= "0123456789abcdef"; + const unsigned char *to_num = (upper ? unum : lnum); unsigned int start = slen ? *slen : 0; unsigned int nlen = 1; /* '0' is one char, we can't have less. */ unsigned int pos = start; /* starting position of the number */ @@ -240,7 +240,8 @@ add_timeval_to_string(struct string *string, timeval_T *timeval) #ifdef HAVE_STRFTIME struct string * -add_date_to_string(struct string *string, unsigned char *fmt, time_t *date) +add_date_to_string(struct string *string, const unsigned char *fmt, + const time_t *date) { unsigned char buffer[MAX_STR_LEN]; time_t when_time = date ? *date : time(NULL); @@ -272,30 +273,77 @@ add_string_replace(struct string *string, unsigned char *src, int len, } struct string * -add_html_to_string(struct string *string, unsigned char *src, int len) +add_html_to_string(struct string *string, const unsigned char *src, int len) { - -#define isalphanum(q) (isalnum(q) || (q) == '-' || (q) == '_') - for (; len; len--, src++) { - if (isalphanum(*src) || *src == ' ' - || *src == '.' || *src == ':' || *src == ';') { - add_bytes_to_string(string, src, 1); + if (*src < 0x20 + || *src == '<' || *src == '>' || *src == '&' + || *src == '\"' || *src == '\'') { + int rollback_length = string->length; + + if (!add_bytes_to_string(string, "&#", 2) + || !add_long_to_string(string, (long) *src) + || !add_char_to_string(string, ';')) { + string->length = rollback_length; + string->source[rollback_length] = '\0'; + return NULL; + } } else { - add_bytes_to_string(string, "&#", 2); - add_long_to_string(string, (long) *src); - add_char_to_string(string, ';'); + if (!add_char_to_string(string, *src)) + return NULL; } } -#undef isalphanum + return string; +} + +struct string * +add_cp_html_to_string(struct string *string, int src_codepage, + const unsigned char *src, int len) +{ + const unsigned char *const end = src + len; + unicode_val_T unicode; + + while (src != end) { + if (is_cp_utf8(src_codepage)) { +#ifdef CONFIG_UTF8 + unicode = utf8_to_unicode((unsigned char **) &src, + end); + if (unicode == UCS_NO_CHAR) + break; +#else /* !CONFIG_UTF8 */ + /* Cannot parse UTF-8 without CONFIG_UTF8. + * Pretend the input is ISO-8859-1 instead. */ + unicode = *src++; +#endif /* !CONFIG_UTF8 */ + } else { + unicode = cp2u(src_codepage, *src++); + } + + if (unicode < 0x20 || unicode >= 0x7F + || unicode == '<' || unicode == '>' || unicode == '&' + || unicode == '\"' || unicode == '\'') { + int rollback_length = string->length; + + if (!add_bytes_to_string(string, "&#", 2) + || !add_long_to_string(string, unicode) + || !add_char_to_string(string, ';')) { + string->length = rollback_length; + string->source[rollback_length] = '\0'; + return NULL; + } + } else { + if (!add_char_to_string(string, unicode)) + return NULL; + } + } return string; } /* TODO Optimize later --pasky */ struct string * -add_quoted_to_string(struct string *string, unsigned char *src, int len) +add_quoted_to_string(struct string *string, const unsigned char *src, int len) { for (; len; len--, src++) { if (isquote(*src) || *src == '\\') diff --git a/src/util/conv.h b/src/util/conv.h index 494a36bb..8f5c2b12 100644 --- a/src/util/conv.h +++ b/src/util/conv.h @@ -53,7 +53,9 @@ struct string *add_timeval_to_string(struct string *string, timeval_T *timeval); #ifdef HAVE_STRFTIME /* Uses strftime() to add @fmt time format to @string. If @time is NULL * time(NULL) will be used. */ -struct string *add_date_to_string(struct string *string, unsigned char *format, time_t *time); +struct string *add_date_to_string(struct string *string, + const unsigned char *format, + const time_t *time); #endif @@ -76,11 +78,22 @@ add_string_replace(struct string *string, unsigned char *src, int len, #define add_real_optname_to_string(str, src, len) \ add_string_replace(str, src, len, '*', '.') -/* Convert reserved chars to html &#xx */ -struct string *add_html_to_string(struct string *string, unsigned char *html, int htmllen); +/* Convert reserved chars to html &#xx;. This function copies bytes + * 0x80...0xFF unchanged, so the caller should ensure that the + * resulting HTML will be parsed with the same charset as the original + * string. (This function cannot use the   syntax for non-ASCII, + * because HTML wants Unicode numbers there and this function does not + * know the charset of the input data.) */ +struct string *add_html_to_string(struct string *string, const unsigned char *html, int htmllen); + +/* Convert reserved or non-ASCII chars to html &#xx;. The resulting + * string can be correctly parsed in any charset where bytes + * 0x20...0x7E match ASCII. */ +struct string *add_cp_html_to_string(struct string *string, int src_codepage, + const unsigned char *html, int htmllen); /* Escapes \ and " with a \ */ -struct string *add_quoted_to_string(struct string *string, unsigned char *q, int qlen); +struct string *add_quoted_to_string(struct string *string, const unsigned char *q, int qlen); /* Adds ', |len| bytes of |src| with all single-quotes converted to '\'', * and ' to |string|. */ diff --git a/src/util/error.c b/src/util/error.c index e2d5408e..34e4c88f 100644 --- a/src/util/error.c +++ b/src/util/error.c @@ -52,7 +52,7 @@ er(int bell, int shall_sleep, unsigned char *fmt, va_list params) } int errline; -unsigned char *errfile; +const unsigned char *errfile; void elinks_debug(unsigned char *fmt, ...) diff --git a/src/util/error.h b/src/util/error.h index 4b56b51d..a97c921b 100644 --- a/src/util/error.h +++ b/src/util/error.h @@ -11,7 +11,7 @@ /* This errfile thing is needed, as we don't have var-arg macros in standart, * only as gcc extension :(. */ extern int errline; -extern unsigned char *errfile; +extern const unsigned char *errfile; /* @DBG(format_string) is used for printing of debugging information. It * should not be used anywhere in the official codebase (although it is often diff --git a/src/util/fastfind.c b/src/util/fastfind.c index 004701d6..3ee3bb5f 100644 --- a/src/util/fastfind.c +++ b/src/util/fastfind.c @@ -596,7 +596,7 @@ fastfind_search(struct fastfind_index *index, unsigned char *key, int key_len) info = index->handle; - assertm(info, "FastFind index %s not initialized", index->comment); + assertm(info != NULL, "FastFind index %s not initialized", index->comment); if_assert_failed return NULL; FF_DBG_search_stats(info, key_len); diff --git a/src/util/file.c b/src/util/file.c index 8015b6cc..d44d83b0 100644 --- a/src/util/file.c +++ b/src/util/file.c @@ -187,7 +187,7 @@ get_tempdir_filename(unsigned char *name) if (!tmpdir || !*tmpdir) tmpdir = getenv("TEMP"); if (!tmpdir || !*tmpdir) tmpdir = "/tmp"; - return straconcat(tmpdir, "/", name, NULL); + return straconcat(tmpdir, "/", name, (unsigned char *) NULL); } unsigned char * @@ -541,7 +541,8 @@ get_directory_entries(unsigned char *dirname, int get_hidden) /* We allocate the full path because it is used in a few places * which means less allocation although a bit more short term * memory usage. */ - name = straconcat(dirname, entry->d_name, NULL); + name = straconcat(dirname, entry->d_name, + (unsigned char *) NULL); if (!name) continue; if (!init_string(&attrib)) { diff --git a/src/util/file.h b/src/util/file.h index a8764356..32121337 100644 --- a/src/util/file.h +++ b/src/util/file.h @@ -5,6 +5,9 @@ #include struct directory_entry { + /* The strings pointed to by this structure are in the system + * charset (i.e. LC_CTYPE) and must be freed with mem_free. */ + /* The various attribute info collected with the stat_* functions. */ unsigned char *attrib; diff --git a/src/util/memdebug.c b/src/util/memdebug.c index 26c65380..612a9156 100644 --- a/src/util/memdebug.c +++ b/src/util/memdebug.c @@ -114,7 +114,7 @@ struct alloc_header { #endif int size; int line; - unsigned char *file; + const unsigned char *file; unsigned char *comment; #ifdef CHECK_XFLOWS @@ -167,8 +167,8 @@ INIT_LIST_HEAD(memory_list); #ifdef LOG_MEMORY_ALLOC static void -dump_short_info(struct alloc_header *ah, unsigned char *file, int line, - unsigned char *type) +dump_short_info(struct alloc_header *ah, const unsigned char *file, int line, + const unsigned char *type) { fprintf(stderr, "%p", PTR_AH2BASE(ah)), fflush(stderr); fprintf(stderr, ":%d", ah->size), fflush(stderr); @@ -184,8 +184,8 @@ dump_short_info(struct alloc_header *ah, unsigned char *file, int line, #endif static void -dump_info(struct alloc_header *ah, unsigned char *info, - unsigned char *file, int line, unsigned char *type) +dump_info(struct alloc_header *ah, const unsigned char *info, + const unsigned char *file, int line, const unsigned char *type) { fprintf(stderr, "%p", PTR_AH2BASE(ah)); fflush(stderr); /* In some extreme cases, we may core here, as 'ah' can no longer point @@ -213,8 +213,8 @@ dump_info(struct alloc_header *ah, unsigned char *info, #ifdef CHECK_AH_SANITY static inline int -bad_ah_sanity(struct alloc_header *ah, unsigned char *info, - unsigned char *file, int line) +bad_ah_sanity(struct alloc_header *ah, const unsigned char *info, + const unsigned char *file, int line) { if (!ah) return 1; if (ah->magic != AH_SANITY_MAGIC) { @@ -228,8 +228,8 @@ bad_ah_sanity(struct alloc_header *ah, unsigned char *info, #ifdef CHECK_XFLOWS static inline int -bad_xflow_magic(struct alloc_header *ah, unsigned char *info, - unsigned char *file, int line) +bad_xflow_magic(struct alloc_header *ah, const unsigned char *info, + const unsigned char *file, int line) { if (!ah) return 1; @@ -282,7 +282,7 @@ check_memory_leaks(void) static int alloc_try = 0; static int -patience(unsigned char *file, int line, unsigned char *of) +patience(const unsigned char *file, int line, const unsigned char *of) { errfile = file; errline = line; @@ -310,7 +310,7 @@ patience(unsigned char *file, int line, unsigned char *of) } void * -debug_mem_alloc(unsigned char *file, int line, size_t size) +debug_mem_alloc(const unsigned char *file, int line, size_t size) { struct alloc_header *ah; size_t true_size; @@ -354,7 +354,7 @@ debug_mem_alloc(unsigned char *file, int line, size_t size) } void * -debug_mem_calloc(unsigned char *file, int line, size_t eltcount, size_t eltsize) +debug_mem_calloc(const unsigned char *file, int line, size_t eltcount, size_t eltsize) { struct alloc_header *ah; size_t size = eltcount * eltsize; @@ -405,7 +405,7 @@ debug_mem_calloc(unsigned char *file, int line, size_t eltcount, size_t eltsize) } void -debug_mem_free(unsigned char *file, int line, void *ptr) +debug_mem_free(const unsigned char *file, int line, void *ptr) { struct alloc_header *ah; int ok = 1; @@ -485,7 +485,7 @@ debug_mem_free(unsigned char *file, int line, void *ptr) } void * -debug_mem_realloc(unsigned char *file, int line, void *ptr, size_t size) +debug_mem_realloc(const unsigned char *file, int line, void *ptr, size_t size) { struct alloc_header *ah, *ah2; size_t true_size; @@ -558,7 +558,7 @@ debug_mem_realloc(unsigned char *file, int line, void *ptr, size_t size) } void -set_mem_comment(void *ptr, unsigned char *str, int len) +set_mem_comment(void *ptr, const unsigned char *str, int len) { struct alloc_header *ah; diff --git a/src/util/memdebug.h b/src/util/memdebug.h index 3917be4f..bcccd41a 100644 --- a/src/util/memdebug.h +++ b/src/util/memdebug.h @@ -12,11 +12,11 @@ struct mem_stats { extern struct mem_stats mem_stats; -void *debug_mem_alloc(unsigned char *, int, size_t); -void *debug_mem_calloc(unsigned char *, int, size_t, size_t); -void debug_mem_free(unsigned char *, int, void *); -void *debug_mem_realloc(unsigned char *, int, void *, size_t); -void set_mem_comment(void *, unsigned char *, int); +void *debug_mem_alloc(const unsigned char *, int, size_t); +void *debug_mem_calloc(const unsigned char *, int, size_t, size_t); +void debug_mem_free(const unsigned char *, int, void *); +void *debug_mem_realloc(const unsigned char *, int, void *, size_t); +void set_mem_comment(void *, const unsigned char *, int); void check_memory_leaks(void); diff --git a/src/util/memlist.c b/src/util/memlist.c index ed24ccd7..f3397532 100644 --- a/src/util/memlist.c +++ b/src/util/memlist.c @@ -26,7 +26,7 @@ /* Create a memory list. If p is NULL or allocation fails, it will * returns NULL. * It always stops at first NULL element. */ -#ifdef DEBUG_MEMLIST +#if defined(DEBUG_MEMLIST) && defined(HAVE_VARIADIC_MACROS) struct memory_list * debug_getml(unsigned char *file, int line, void *p, ...) #else @@ -69,7 +69,7 @@ getml(void *p, ...) * If memory list exists, it enlarges it, else it creates it. * if there's no elements or first element is NULL, it does nothing. * It always stops at first NULL element. */ -#ifdef DEBUG_MEMLIST +#if defined(DEBUG_MEMLIST) && defined(HAVE_VARIADIC_MACROS) void debug_add_to_ml(unsigned char *file, int line, struct memory_list **ml, ...) #else @@ -89,7 +89,11 @@ add_to_ml(struct memory_list **ml, ...) /* None, so just return. */ if (!n) { #ifdef DEBUG_MEMLIST +#ifdef HAVE_VARIADIC_MACROS errline = line, errfile = file; +#else + errline = 0, errfile = "?"; +#endif elinks_error("add_to_ml(%p, NULL, ...)", ml); #endif return; diff --git a/src/util/memory.c b/src/util/memory.c index 81dfbc82..78ef23d2 100644 --- a/src/util/memory.c +++ b/src/util/memory.c @@ -187,7 +187,7 @@ mem_mmap_realloc(void *p, size_t old_size, size_t new_size) void *p2 = mem_mmap_alloc(new_size); if (p2) { - memcpy(p2, p, old_size); + memcpy(p2, p, MIN(old_size, new_size)); mem_mmap_free(p, old_size); return p2; } diff --git a/src/util/memory.h b/src/util/memory.h index 87cf2cc4..9fab2fd4 100644 --- a/src/util/memory.h +++ b/src/util/memory.h @@ -124,7 +124,7 @@ void *mem_realloc(void *, size_t); static inline void * mem_align_alloc__( #ifdef DEBUG_MEMLEAK - unsigned char *file, int line, + const unsigned char *file, int line, #endif void **ptr, size_t old, size_t new, size_t objsize, size_t mask) { diff --git a/src/util/secsave.c b/src/util/secsave.c index 6e9d7666..fae599f2 100644 --- a/src/util/secsave.c +++ b/src/util/secsave.c @@ -151,7 +151,8 @@ secure_open_umask(unsigned char *file_name) */ int fd; unsigned char *randname = straconcat(ssi->file_name, - ".tmp_XXXXXX", NULL); + ".tmp_XXXXXX", + (unsigned char *) NULL); if (!randname) { secsave_errno = SS_ERR_OUT_OF_MEM; diff --git a/src/util/string.c b/src/util/string.c index b8865568..44e6cd0a 100644 --- a/src/util/string.c +++ b/src/util/string.c @@ -34,13 +34,13 @@ #define string_assert(f, l, x, o) \ if ((assert_failed = !(x))) { \ errfile = f, errline = l, \ - elinks_internal("[" o "] assertion " #x " failed!"); \ + elinks_internal("[%s] assertion %s failed!", o, #x); \ } #ifdef DEBUG_MEMLEAK unsigned char * -debug_memacpy(unsigned char *f, int l, unsigned char *src, int len) +debug_memacpy(const unsigned char *f, int l, const unsigned char *src, int len) { unsigned char *m; @@ -57,7 +57,7 @@ debug_memacpy(unsigned char *f, int l, unsigned char *src, int len) } unsigned char * -debug_stracpy(unsigned char *f, int l, unsigned char *src) +debug_stracpy(const unsigned char *f, int l, const unsigned char *src) { string_assert(f, l, src, "stracpy"); if_assert_failed return NULL; @@ -68,7 +68,7 @@ debug_stracpy(unsigned char *f, int l, unsigned char *src) #else /* DEBUG_MEMLEAK */ unsigned char * -memacpy(unsigned char *src, int len) +memacpy(const unsigned char *src, int len) { unsigned char *m; @@ -85,7 +85,7 @@ memacpy(unsigned char *src, int len) } unsigned char * -stracpy(unsigned char *src) +stracpy(const unsigned char *src) { assertm(src, "[stracpy]"); if_assert_failed return NULL; @@ -97,7 +97,7 @@ stracpy(unsigned char *src) void -add_to_strn(unsigned char **dst, unsigned char *src) +add_to_strn(unsigned char **dst, const unsigned char *src) { unsigned char *newdst; int dstlen; @@ -116,7 +116,8 @@ add_to_strn(unsigned char **dst, unsigned char *src) } unsigned char * -insert_in_string(unsigned char **dst, int pos, unsigned char *seq, int seqlen) +insert_in_string(unsigned char **dst, int pos, + const unsigned char *seq, int seqlen) { int dstlen = strlen(*dst); unsigned char *string = mem_realloc(*dst, dstlen + seqlen + 1); @@ -131,14 +132,14 @@ insert_in_string(unsigned char **dst, int pos, unsigned char *seq, int seqlen) } unsigned char * -straconcat(unsigned char *str, ...) +straconcat(const unsigned char *str, ...) { va_list ap; - unsigned char *a; + const unsigned char *a; unsigned char *s; unsigned int len; - assertm(str, "[straconcat]"); + assertm(str != NULL, "[straconcat]"); if_assert_failed { return NULL; } len = strlen(str); @@ -148,7 +149,7 @@ straconcat(unsigned char *str, ...) if (len) memcpy(s, str, len); va_start(ap, str); - while ((a = va_arg(ap, unsigned char *))) { + while ((a = va_arg(ap, const unsigned char *))) { unsigned int l = strlen(a); unsigned char *ns; @@ -172,7 +173,7 @@ straconcat(unsigned char *str, ...) } int -xstrcmp(unsigned char *s1, unsigned char *s2) +xstrcmp(const unsigned char *s1, const unsigned char *s2) { if (!s1) return -!!s2; if (!s2) return 1; @@ -244,12 +245,12 @@ elinks_strlcasecmp(const unsigned char *s1, size_t n1, inline struct string * #ifdef DEBUG_MEMLEAK -init_string__(unsigned char *file, int line, struct string *string) +init_string__(const unsigned char *file, int line, struct string *string) #else init_string(struct string *string) #endif { - assertm(string, "[init_string]"); + assertm(string != NULL, "[init_string]"); if_assert_failed { return NULL; } string->length = 0; @@ -270,7 +271,7 @@ init_string(struct string *string) inline void done_string(struct string *string) { - assertm(string, "[done_string]"); + assertm(string != NULL, "[done_string]"); if_assert_failed { return; } if (string->source) { @@ -301,7 +302,7 @@ add_to_string(struct string *string, const unsigned char *source) inline struct string * add_crlf_to_string(struct string *string) { - assertm(string, "[add_crlf_to_string]"); + assertm(string != NULL, "[add_crlf_to_string]"); if_assert_failed { return NULL; } check_string_magic(string); @@ -317,7 +318,7 @@ add_crlf_to_string(struct string *string) } inline struct string * -add_string_to_string(struct string *string, struct string *from) +add_string_to_string(struct string *string, const struct string *from) { assertm(string && from, "[add_string_to_string]"); if_assert_failed { return NULL; } @@ -325,13 +326,13 @@ add_string_to_string(struct string *string, struct string *from) check_string_magic(string); check_string_magic(from); - if (!*from->source) return NULL; + if (!from->length) return string; /* optimization only */ return add_bytes_to_string(string, from->source, from->length); } struct string * -add_file_to_string(struct string *string, unsigned char *filename) +add_file_to_string(struct string *string, const unsigned char *filename) { FILE *file; off_t filelen; @@ -374,15 +375,15 @@ struct string * string_concat(struct string *string, ...) { va_list ap; - unsigned char *source; + const unsigned char *source; - assertm(string, "[string_concat]"); + assertm(string != NULL, "[string_concat]"); if_assert_failed { return NULL; } check_string_magic(string); va_start(ap, string); - while ((source = va_arg(ap, unsigned char *))) + while ((source = va_arg(ap, const unsigned char *))) if (*source) add_to_string(string, source); @@ -433,7 +434,7 @@ add_xchar_to_string(struct string *string, unsigned char character, int times) /* Add printf-like format string to @string. */ struct string * -add_format_to_string(struct string *string, unsigned char *format, ...) +add_format_to_string(struct string *string, const unsigned char *format, ...) { int newlength; int width; @@ -495,7 +496,7 @@ add_to_string_list(struct list_head *list, const unsigned char *source, void free_string_list(struct list_head *list) { - assertm(list, "[free_string_list]"); + assertm(list != NULL, "[free_string_list]"); if_assert_failed return; while (!list_empty(*list)) { diff --git a/src/util/string.h b/src/util/string.h index 4e04bac6..123cac2b 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -25,17 +25,17 @@ /* Allocates NUL terminated string with @len bytes from @src. * If @src == NULL or @len < 0 only one byte is allocated and set it to 0. */ /* Returns the string or NULL on allocation failure. */ -unsigned char *memacpy(unsigned char *src, int len); +unsigned char *memacpy(const unsigned char *src, int len); /* Allocated NUL terminated string with the content of @src. */ -unsigned char *stracpy(unsigned char *src); +unsigned char *stracpy(const unsigned char *src); #else /* DEBUG_MEMLEAK */ -unsigned char *debug_memacpy(unsigned char *, int, unsigned char *, int); +unsigned char *debug_memacpy(const unsigned char *, int, const unsigned char *, int); #define memacpy(s, l) debug_memacpy(__FILE__, __LINE__, s, l) -unsigned char *debug_stracpy(unsigned char *, int, unsigned char *); +unsigned char *debug_stracpy(const unsigned char *, int, const unsigned char *); #define stracpy(s) debug_stracpy(__FILE__, __LINE__, s) #endif /* DEBUG_MEMLEAK */ @@ -43,28 +43,28 @@ unsigned char *debug_stracpy(unsigned char *, int, unsigned char *); /* Concatenates @src to @str. */ /* If reallocation of @str fails @str is not touched. */ -void add_to_strn(unsigned char **str, unsigned char *src); +void add_to_strn(unsigned char **str, const unsigned char *src); /* Inserts @seqlen chars from @seq at position @pos in the @dst string. */ /* If reallocation of @dst fails it is not touched and NULL is returned. */ -unsigned char * -insert_in_string(unsigned char **dst, int pos, unsigned char *seq, int seqlen); +unsigned char *insert_in_string(unsigned char **dst, int pos, + const unsigned char *seq, int seqlen); -/* Takes a list of strings where the last parameter _must_ be NULL and - * concatenates them. */ +/* Takes a list of strings where the last parameter _must_ be + * (unsigned char *) NULL and concatenates them. */ /* Returns the allocated string or NULL on allocation failure. */ /* Example: - * unsigned char *abc = straconcat("A", "B", "C", NULL); + * unsigned char *abc = straconcat("A", "B", "C", (unsigned char *) NULL); * if (abc) return; * printf("%s", abc); -> print "ABC" * mem_free(abc); -> free memory used by @abc */ -unsigned char *straconcat(unsigned char *str, ...); +unsigned char *straconcat(const unsigned char *str, ...); /* Misc. utility string functions. */ /* Compare two strings, handling correctly @s1 or @s2 being NULL. */ -int xstrcmp(unsigned char *s1, unsigned char *s2); +int xstrcmp(const unsigned char *s1, const unsigned char *s2); /* Copies at most @len chars into @dst. Ensures null termination of @dst. */ unsigned char *safe_strncpy(unsigned char *dst, const unsigned char *src, size_t len); @@ -109,9 +109,14 @@ int elinks_strlcasecmp(const unsigned char *s1, size_t n1, #define isasciialnum(c) (isasciialpha(c) || isdigit(c)) #define isident(c) (isasciialnum(c) || (c) == '_' || (c) == '-') -/* Char is safe to write to the terminal screen */ +/* Char is safe to write to the terminal screen. Cannot test for C1 + * control characters (0x80 to 0x9F) because this is also used for + * non-ISO-8859 charsets. */ #define isscreensafe(c) ((c) >= ' ' && (c) != ASCII_DEL) +/* Like isscreensafe but takes Unicode values and so can check for C1. */ +#define isscreensafe_ucs(c) (((c) >= 0x20 && (c) <= 0x7E) || (c) >= 0xA0) + /* String debugging using magic number, it may catch some errors. */ #ifdef CONFIG_DEBUG @@ -145,7 +150,7 @@ struct string { /* Initializes the passed string struct by preallocating the @source member. */ #ifdef DEBUG_MEMLEAK -struct string *init_string__(unsigned char *file, int line, struct string *string); +struct string *init_string__(const unsigned char *file, int line, struct string *string); #define init_string(string) init_string__(__FILE__, __LINE__, string) #else struct string *init_string(struct string *string); @@ -158,18 +163,19 @@ void done_string(struct string *string); struct string *add_to_string(struct string *string, const unsigned char *source); struct string *add_char_to_string(struct string *string, unsigned char character); -struct string *add_string_to_string(struct string *to, struct string *from); -struct string *add_file_to_string(struct string *string, unsigned char *filename); +struct string *add_string_to_string(struct string *to, const struct string *from); +struct string *add_file_to_string(struct string *string, const unsigned char *filename); struct string *add_crlf_to_string(struct string *string); -/* Adds each C string to @string until a terminating NULL is met. */ +/* Adds each C string to @string until a terminating + * (unsigned char *) NULL is met. */ struct string *string_concat(struct string *string, ...); /* Extends the string with @times number of @character. */ struct string *add_xchar_to_string(struct string *string, unsigned char character, int times); /* Add printf-style format string to @string. */ -struct string *add_format_to_string(struct string *string, unsigned char *format, ...); +struct string *add_format_to_string(struct string *string, const unsigned char *format, ...); /* Get a regular newly allocated stream of bytes from @string. */ static unsigned char *squeezastring(struct string *string); @@ -209,7 +215,7 @@ squeezastring(struct string *string) static inline struct string * add_bytes_to_string__( #ifdef DEBUG_MEMLEAK - unsigned char *file, int line, + const unsigned char *file, int line, #endif struct string *string, const unsigned char *bytes, int length) diff --git a/src/util/time.c b/src/util/time.c index 8e0637ea..d7691a14 100644 --- a/src/util/time.c +++ b/src/util/time.c @@ -134,6 +134,8 @@ timeval_from_milliseconds(timeval_T *t, milliseconds_T milliseconds) return t; } +/* Bug 923: Assumes time_t values fit in long. (This function is used + * for both timestamps and durations.) */ timeval_T * timeval_from_seconds(timeval_T *t, long seconds) { @@ -184,6 +186,8 @@ timeval_to_milliseconds(timeval_T *t) return add_ms_to_ms(a, b); } +/* Bug 923: Assumes time_t values fit in long. (This function is used + * for both timestamps and durations.) */ long timeval_to_seconds(timeval_T *t) { @@ -202,8 +206,10 @@ timeval_limit_to_zero_or_one(timeval_T *t) { if (t->sec < 0) t->sec = 0; if (t->usec < 0) t->usec = 0; +#ifdef CONFIG_OS_WIN32 /* Under Windows I got 300 seconds timeout, so 1 second should not hurt --witekfl */ if (t->sec > 1) t->sec = 1; +#endif } /* Returns 1 if t1 > t2 diff --git a/src/util/time.h b/src/util/time.h index 6fa73b0b..7d81a775 100644 --- a/src/util/time.h +++ b/src/util/time.h @@ -16,13 +16,20 @@ typedef long milliseconds_T; #define ms_max(a, b) ((a) < (b) ? (b) : (a)) #define ms_min(a, b) ((a) < (b) ? (a) : (b)) -/* Is using atol() in this way acceptable? It seems - * non-portable to me; time_t might not be a long. -- Miciah */ +/* Bug 923: Assumes time_t values fit in long. */ #define str_to_time_t(s) ((time_t) atol(s)) +/* When formatting time_t values to be parsed with str_to_time_t, + * we first cast to time_print_T and then printf the result with + * TIME_PRINT_FORMAT. + * Bug 923: Assumes time_t values fit in long. */ +typedef long time_print_T; +#define TIME_PRINT_FORMAT "ld" /* Redefine a timeval that has all fields signed so calculations * will be simplified on rare systems that define timeval with - * unsigned fields. */ + * unsigned fields. + * Bug 923: Assumes time_t values fit in long. (This structure is + * used for both timestamps and durations.) */ typedef struct { long sec; long usec; } timeval_T; timeval_T *timeval_from_milliseconds(timeval_T *t, milliseconds_T milliseconds); diff --git a/src/viewer/dump/dump.c b/src/viewer/dump/dump.c index 506b5e63..63b2bf1f 100644 --- a/src/viewer/dump/dump.c +++ b/src/viewer/dump/dump.c @@ -132,6 +132,9 @@ dump_formatted(int fd, struct download *download, struct cache_entry *cached) case COLOR_MODE_MONO: /* FIXME: inversion */ dump_to_file(formatted.document, fd); break; + default: + /* If the desired color mode was not compiled in, + * use 16 colors. */ case COLOR_MODE_16: dump_to_file_16(formatted.document, fd); break; @@ -150,8 +153,6 @@ dump_formatted(int fd, struct download *download, struct cache_entry *cached) dump_to_file_true_color(formatted.document, fd); break; #endif - default: - break; } detach_formatted(&formatted); @@ -396,33 +397,34 @@ add_document_to_string(struct string *string, struct document *document) goto end; utf8: for (y = 0; y < document->height; y++) { - struct screen_char *pos = document->data[y].chars; int white = 0; int x; for (x = 0; x < document->data[y].length; x++) { + struct screen_char *pos = &document->data[y].chars[x]; unicode_val_T data = pos->data; unsigned int frame = (pos->attr & SCREEN_ATTR_FRAME); - if (!isscreensafe(data)) { + if (!isscreensafe_ucs(data)) { white++; continue; - } else if (frame && data >= 176 && data < 224) { - data = frame_dumb[data - 176]; + } else { + if (frame && data >= 176 && data < 224) + data = frame_dumb[data - 176]; if (data <= ' ') { /* Count spaces. */ white++; + } else if (data == UCS_NO_CHAR) { + /* This is the second cell of + * a double-cell character. */ } else { /* Print spaces if any. */ if (white) { add_xchar_to_string(string, ' ', white); white = 0; } - if (frame) - add_char_to_string(string, data); - else - add_to_string(string, encode_utf8(data)); + add_to_string(string, encode_utf8(data)); } } } diff --git a/src/viewer/text/form.c b/src/viewer/text/form.c index 83d904f4..01d517c7 100644 --- a/src/viewer/text/form.c +++ b/src/viewer/text/form.c @@ -322,7 +322,7 @@ draw_form_entry(struct terminal *term, struct document_view *doc_view, if_assert_failed return; fc = get_link_form_control(link); - assertm(fc, "link %d has no form control", (int) (link - doc_view->document->links)); + assertm(fc != NULL, "link %d has no form control", (int) (link - doc_view->document->links)); if_assert_failed return; fs = find_form_state(doc_view, fc); @@ -659,13 +659,13 @@ add_submitted_value_to_list(struct form_control *fc, break; case FC_IMAGE: - name = straconcat(fc->name, ".x", NULL); + name = straconcat(fc->name, ".x", (unsigned char *) NULL); if (!name) break; sub = init_submitted_value(name, "0", type, fc, position); mem_free(name); if (sub) add_to_list(*list, sub); - name = straconcat(fc->name, ".y", NULL); + name = straconcat(fc->name, ".y", (unsigned char *) NULL); if (!name) break; sub = init_submitted_value(name, "0", type, fc, position); mem_free(name); @@ -1358,6 +1358,7 @@ field_op(struct session *ses, struct document_view *doc_view, int length; enum frame_event_status status = FRAME_EVENT_REFRESH; #ifdef CONFIG_UTF8 + const unsigned char *ctext; int utf8 = ses->tab->term->utf8; #endif /* CONFIG_UTF8 */ @@ -1365,7 +1366,7 @@ field_op(struct session *ses, struct document_view *doc_view, if_assert_failed return FRAME_EVENT_OK; fc = get_link_form_control(link); - assertm(fc, "link has no form control"); + assertm(fc != NULL, "link has no form control"); if_assert_failed return FRAME_EVENT_OK; if (fc->mode == FORM_MODE_DISABLED || ev->ev != EVENT_KBD @@ -1748,19 +1749,19 @@ field_op(struct session *ses, struct document_view *doc_view, if (ses->tab->term->utf8) { /* fs->value is in UTF-8 regardless of * the charset of the terminal. */ - text = encode_utf8(get_kbd_key(ev)); + ctext = encode_utf8(get_kbd_key(ev)); } else { /* fs->value is in the charset of the * terminal. */ int cp = get_opt_codepage_tree(ses->tab->term->spec, "charset"); - text = u2cp_no_nbsp(get_kbd_key(ev), cp); + ctext = u2cp_no_nbsp(get_kbd_key(ev), cp); } - length = strlen(text); + length = strlen(ctext); if (strlen(fs->value) + length > fc->maxlength - || !insert_in_string(&fs->value, fs->state, text, length)) { + || !insert_in_string(&fs->value, fs->state, ctext, length)) { status = FRAME_EVENT_OK; break; } diff --git a/src/viewer/text/link.c b/src/viewer/text/link.c index 40e65e03..2c500074 100644 --- a/src/viewer/text/link.c +++ b/src/viewer/text/link.c @@ -1019,6 +1019,14 @@ activate_link(struct session *ses, struct document_view *doc_view, return FRAME_EVENT_REFRESH; } + /* @link_fc->type must be FC_RADIO, then. First turn + * this one on, and then turn off all the other radio + * buttons in the group. Do it in this order because + * further @find_form_state calls may reallocate + * @doc_view->vs->form_info[] and thereby make the @fs + * pointer invalid. This also allows us to re-use + * @fs in the loop. */ + fs->state = 1; foreach (form, doc_view->document->forms) { struct form_control *fc; @@ -1027,15 +1035,13 @@ activate_link(struct session *ses, struct document_view *doc_view, foreach (fc, form->items) { if (fc->type == FC_RADIO - && !xstrcmp(fc->name, link_fc->name)) { - struct form_state *frm_st; - - frm_st = find_form_state(doc_view, fc); - if (frm_st) frm_st->state = 0; + && !xstrcmp(fc->name, link_fc->name) + && fc != link_fc) { + fs = find_form_state(doc_view, fc); + if (fs) fs->state = 0; } } } - fs->state = 1; break; @@ -1191,7 +1197,6 @@ try_document_key(struct session *ses, struct document_view *doc_view, struct term_event *ev) { unicode_val_T key; - int passed = -1; int i; /* GOD I HATE C! --FF */ /* YEAH, BRAINFUCK RULEZ! --pasky */ assert(ses && doc_view && doc_view->document && doc_view->vs && ev); @@ -1218,24 +1223,24 @@ try_document_key(struct session *ses, struct document_view *doc_view, /* Run through all the links and see if one of them is bound to the * key we test.. */ - for (i = 0; i < doc_view->document->nlinks; i++) { + + i = doc_view->vs->current_link + 1; + for (; i < doc_view->document->nlinks; i++) { struct link *link = &doc_view->document->links[i]; if (key == link->accesskey) { - if (passed != i && i <= doc_view->vs->current_link) { - /* This is here in order to rotate between - * links with same accesskey. */ - if (passed < 0) passed = i; - continue; - } ses->kbdprefix.repeat_count = 0; goto_link_number_do(ses, doc_view, i); return FRAME_EVENT_REFRESH; } + } + for (i = 0; i <= doc_view->vs->current_link; i++) { + struct link *link = &doc_view->document->links[i]; - if (i == doc_view->document->nlinks - 1 && passed >= 0) { - /* Return to the start. */ - i = passed - 1; + if (key == link->accesskey) { + ses->kbdprefix.repeat_count = 0; + goto_link_number_do(ses, doc_view, i); + return FRAME_EVENT_REFRESH; } } diff --git a/src/viewer/text/marks.c b/src/viewer/text/marks.c index eafdcc88..ced1ae51 100644 --- a/src/viewer/text/marks.c +++ b/src/viewer/text/marks.c @@ -10,6 +10,7 @@ #include "elinks.h" #include "document/view.h" +#include "intl/gettext/libintl.h" #include "main/module.h" #include "protocol/uri.h" #include "util/memory.h" @@ -71,6 +72,7 @@ index_from_char(unsigned char mark) void goto_mark(unsigned char mark, struct view_state *vs) { + int old_current_link; #ifdef CONFIG_ECMASCRIPT struct ecmascript_interpreter *ecmascript; int ecmascript_fragile; @@ -88,6 +90,7 @@ goto_mark(unsigned char mark, struct view_state *vs) if (!marks[i] || !compare_uri(marks[i]->uri, vs->uri, 0)) return; + old_current_link = vs->current_link; #ifdef CONFIG_ECMASCRIPT ecmascript = vs->ecmascript; ecmascript_fragile = vs->ecmascript_fragile; @@ -103,6 +106,7 @@ goto_mark(unsigned char mark, struct view_state *vs) vs->ecmascript = ecmascript; vs->ecmascript_fragile = ecmascript_fragile; #endif + vs->old_current_link = old_current_link; } static void @@ -148,7 +152,7 @@ done_marks(struct module *xxx) } struct module viewer_marks_module = struct_module( - /* name: */ "Marks", + /* name: */ N_("Marks"), /* options: */ NULL, /* hooks: */ NULL, /* submodules: */ NULL, diff --git a/src/viewer/text/search.c b/src/viewer/text/search.c index d492a074..a3ca067e 100644 --- a/src/viewer/text/search.c +++ b/src/viewer/text/search.c @@ -892,7 +892,10 @@ point_intersect(struct point *p1, int l1, struct point *p2, int l2) assert(p2); if_assert_failed return 0; - if (first_time) memset(hash, 0, HASH_SIZE), first_time = 0; + if (first_time) { + memset(hash, 0, HASH_SIZE); + first_time = 0; + } for (i = 0; i < l1; i++) hash[HASH(p1[i])] = 1; @@ -1369,7 +1372,7 @@ text_typeahead_handler(struct input_line *line, int action_id) int report_errors = action_id == -1; enum find_error error; - assertm(doc_view, "document not formatted"); + assertm(doc_view != NULL, "document not formatted"); if_assert_failed return INPUT_LINE_CANCEL; switch (action_id) { @@ -1400,7 +1403,7 @@ text_typeahead_handler(struct input_line *line, int action_id) opt->value.number = (opt->value.number + 1) % (opt->max + 1); - option_changed(ses, opt, opt); + option_changed(ses, opt); } /* Fall thru */ @@ -1434,7 +1437,7 @@ link_typeahead_handler(struct input_line *line, int action_id) struct document_view *doc_view = current_frame(ses); int offset = 0; - assertm(doc_view, "document not formatted"); + assertm(doc_view != NULL, "document not formatted"); if_assert_failed return INPUT_LINE_CANCEL; /* If there is nothing to match with don't start searching */ @@ -1651,7 +1654,7 @@ search_dlg_do(struct terminal *term, struct memory_list *ml, dlg->udata = text; dlg->udata2 = hop; - add_to_ml(&ml, hop, NULL); + add_to_ml(&ml, (void *) hop, (void *) NULL); /* @field is automatically cleared by calloc() */ field = get_dialog_offset(dlg, SEARCH_WIDGETS_COUNT); @@ -1668,7 +1671,7 @@ search_dlg_do(struct terminal *term, struct memory_list *ml, add_dlg_end(dlg, SEARCH_WIDGETS_COUNT); - add_to_ml(&ml, dlg, NULL); + add_to_ml(&ml, (void *) dlg, (void *) NULL); do_dialog(term, dlg, ml); } diff --git a/src/viewer/text/textarea.c b/src/viewer/text/textarea.c index b6c9457d..14796e34 100644 --- a/src/viewer/text/textarea.c +++ b/src/viewer/text/textarea.c @@ -330,7 +330,7 @@ draw_textarea_utf8(struct terminal *term, struct form_state *fs, assert(term && doc_view && doc_view->document && doc_view->vs && link); if_assert_failed return; fc = get_link_form_control(link); - assertm(fc, "link %d has no form control", (int) (link - doc_view->document->links)); + assertm(fc != NULL, "link %d has no form control", (int) (link - doc_view->document->links)); if_assert_failed return; box = &doc_view->box; @@ -419,7 +419,7 @@ draw_textarea(struct terminal *term, struct form_state *fs, } #endif /* CONFIG_UTF8 */ fc = get_link_form_control(link); - assertm(fc, "link %d has no form control", (int) (link - doc_view->document->links)); + assertm(fc != NULL, "link %d has no form control", (int) (link - doc_view->document->links)); if_assert_failed return; box = &doc_view->box; @@ -532,22 +532,41 @@ static unsigned char * save_textarea_file(unsigned char *value) { unsigned char *filename; - FILE *file = NULL; - int h; + FILE *fp = NULL; + int fd; + size_t nmemb, len; filename = get_tempdir_filename("elinks-area-XXXXXX"); if (!filename) return NULL; - h = safe_mkstemp(filename); - if (h >= 0) file = fdopen(h, "w"); - - if (file) { - fwrite(value, strlen(value), 1, file); - fclose(file); - } else { + fd = safe_mkstemp(filename); + if (fd < 0) { mem_free(filename); + return NULL; } + len = strlen(value); + if (len == 0) return filename; + + fp = fdopen(fd, "w"); + if (!fp) { + +error: + unlink(filename); + mem_free(filename); + close(fd); + return NULL; + } + + nmemb = fwrite(value, len, 1, fp); + if (nmemb != 1) { + fclose(fp); + goto error; + } + + if (fclose(fp) != 0) + goto error; + return filename; } @@ -592,7 +611,7 @@ textarea_edit(int op, struct terminal *term_, struct form_state *fs_, if (!ed || !*ed) ed = "vi"; } - ex = straconcat(ed, " ", fn, NULL); + ex = straconcat(ed, " ", fn, (unsigned char *) NULL); if (!ex) { unlink(fn); goto free_and_return; @@ -622,6 +641,10 @@ textarea_edit(int op, struct terminal *term_, struct form_state *fs_, if (file.length > fc_maxlength) { file.source[fc_maxlength] = '\0'; + /* Casting size_t fc_maxlength to unsigned int + * and formatting it with "%u" is safe, + * because fc_maxlength is smaller than + * file.length, which is an int. */ info_box(term, MSGBOX_FREE_TEXT, N_("Warning"), ALIGN_CENTER, msg_text(term, @@ -633,7 +656,7 @@ textarea_edit(int op, struct terminal *term_, struct form_state *fs_, " but you can still recover the" " text that you entered from" " this file: %s"), file.length, - fc_maxlength, fn)); + (unsigned int) fc_maxlength, fn)); } else { unlink(fn); } @@ -1183,7 +1206,7 @@ set_textarea(struct document_view *doc_view, int direction) return; fc = get_link_form_control(link); - assertm(fc, "link has no form control"); + assertm(fc != NULL, "link has no form control"); if_assert_failed return; if (fc->mode == FORM_MODE_DISABLED) return; diff --git a/src/viewer/timer.c b/src/viewer/timer.c index 610d621b..2aa467c1 100644 --- a/src/viewer/timer.c +++ b/src/viewer/timer.c @@ -8,6 +8,7 @@ #include "config/kbdbind.h" #include "config/options.h" +#include "intl/gettext/libintl.h" #include "main/module.h" #include "main/timer.h" #include "terminal/event.h" @@ -84,7 +85,7 @@ done_timer(struct module *module) } struct module timer_module = struct_module( - /* name: */ "Timer", + /* name: */ N_("Timer"), /* options: */ NULL, /* hooks: */ NULL, /* submodules: */ NULL, diff --git a/test/cgi/print-post.sh b/test/cgi/print-post.sh new file mode 100755 index 00000000..ddc05c60 --- /dev/null +++ b/test/cgi/print-post.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +echo "Content-Type: text/plain" +echo +echo "POST DATA:" +cat -