1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-30 03:26:23 -04:00

Merge with /srv/git/elinks.git

This commit is contained in:
Petr Baudis 2006-07-13 02:49:41 +02:00 committed by Petr Baudis
commit 250669b0e9
27 changed files with 276 additions and 121 deletions

View File

@ -556,6 +556,9 @@ Unai Uribarri <unai@telecable.es>
Varga Balázs <vinnui@ent.hu>
Hungarian translation updates
Vitaly Lavrov <lve@guap.ru>
Fix for http digest authentification
Wiktor Grebla <greblus@poczta.onet.pl>
Keybinding for toggling of document.browse.links.numbering

View File

@ -25,9 +25,11 @@ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
ifdef V
quiet =
mquiet = masq_
Q =
else
quiet = quiet_
mquiet = quiet_
Q = @
endif
# Show the command (quiet or non-quiet version based on the assignment
@ -121,7 +123,7 @@ endif
rm .deps/$(*F).pp; \
fi
CLEAN += $(PROG) $(OBJS)
CLEAN += $(PROGS) $(OBJS) $(LIB_O_NAME)
#############################################################################
@ -139,7 +141,7 @@ init-default:
|| echo 'include $(SRC)/$(RELPATH)/$(subdir)/Makefile' > $(subdir)/Makefile;)
clean-default cleanall-default:
@-test -z "$(CLEAN)" || $(RM) $(CLEAN)
$(Q)-test -z "$(CLEAN)" || $(RM) $(CLEAN)
check-default:
ifneq ($(SPARSE),)

View File

@ -808,10 +808,9 @@ if test "$enable_python" = "yes"; then
cf_result=no
else
PYTHON_CFLAGS="-I`$PYTHON -c 'from distutils import sysconfig; print sysconfig.get_python_inc()' 2> /dev/null`"
PYTHON_LIBS="-lpython`$PYTHON -c 'from distutils import sysconfig; print sysconfig.get_config_var("VERSION")' 2> /dev/null`"
if test -n "$python_prefix" && test -d "$python_prefix/lib"; then
PYTHON_LIBS="-L$python_prefix/lib -lpython"
else
PYTHON_LIBS="-lpython"
PYTHON_LIBS="-L$python_prefix/lib $PYTHON_LIBS"
fi
LIBS="$PYTHON_LIBS $LIBS"
CFLAGS="$PYTHON_CFLAGS $CFLAGS"

View File

@ -27,14 +27,25 @@ care of installation through a package system. Below are listed instructions
on what package you need to install on various systems (please help improve
the list). If all goes well you can proceed to rebuilding ELinks.
On Debian testing or unstable, install the packages 'libsmjs1' and
'libsmjs-dev' by running:
On Debian testing (Etch) or unstable (SID), run the following:
$ apt-get install libsmjs1 libsmjs-dev
$ apt-get install libmozjs-dev
So, you need to get (and install) SpiderMonkey and then recompile your ELinks
(if you installed SM properly, ELinks should autodetect it during the
configure phase) and you are ready to fly.
On Debian stable (Sarge), run the following:
$ apt-get install libsmjs-dev
Installing the -dev package will automatically pull in the library package.
Once this is done, rebuild ELinks. The configure script should detect
the SpiderMonkey library--check for this line in the features summary:
ECMAScript (JavaScript) ......... SpiderMonkey document scripting
After following these instructions on a Debian system, you are done and should
ignore the following directions.
The rest is only for non-Debian system.
Note that this procedure enables you to install SpiderMonkey, but in such a
way that it might not work with anything else but ELinks. It is unlikely that
@ -83,6 +94,9 @@ Check for:
libjs.so -> libjs.so
If you don't get such result, check that the library's installation path
(e.g. /usr/local/lib) is present in /etc/ld.so.conf (man 8 ldconfig).
If all went well, you can proceed to rebuild ELinks now. If something broke,
see you on #elinks @ FreeNode or in the mailing list.
You may add your options to `./configure` as usual; SpiderMonkey should be
@ -91,7 +105,11 @@ autodetected.
$ cd ../..
$ ./configure
Check for "`Ecmascript .................... SpiderMonkey`" in Feature summary.
Check for the following line in the features summary:
ECMAScript (JavaScript) ......... SpiderMonkey document scripting
Then run:
$ make
$ su -c 'make install'

124
po/pl.po
View File

@ -11,8 +11,8 @@ msgid ""
msgstr ""
"Project-Id-Version: ELinks 0.12.GIT\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2006-06-18 17:49+0200\n"
"PO-Revision-Date: 2006-06-18 18:00+0200\n"
"POT-Creation-Date: 2006-06-30 21:43+0200\n"
"PO-Revision-Date: 2006-06-30 22:00+0200\n"
"Last-Translator: Witold Filipczyk <witekfl@pld-linux.org>\n"
"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
"MIME-Version: 1.0\n"
@ -736,40 +736,52 @@ msgstr "Skasuj do pocz
msgid "Delete to end of line"
msgstr "Skasuj do koñca linii"
#: src/config/actions-edit.inc:23 src/config/actions-menu.inc:15
#: src/config/actions-edit.inc:23
msgid "Delete backwards to start of word"
msgstr "Skasuj do ty³u do pocz±tku s³owa"
#: src/config/actions-edit.inc:24 src/config/actions-menu.inc:15
msgid "Move the cursor left"
msgstr "Przesuñ kursor w lewo"
#: src/config/actions-edit.inc:24 src/config/actions-menu.inc:17
#: src/config/actions-edit.inc:25
msgid "Move cursor before current word"
msgstr "Przesuñ kursor przed bie¿±ce s³owo"
#: src/config/actions-edit.inc:26
msgid "Move cursor after current word"
msgstr "Przesuñ kursor za bie¿±ce s³owo"
#: src/config/actions-edit.inc:27 src/config/actions-menu.inc:17
msgid "Move to the next item"
msgstr "Przesuñ do nastêpnej pozycji"
#: src/config/actions-edit.inc:25
#: src/config/actions-edit.inc:28
msgid "Open in external editor"
msgstr "Otwórz w zewnêtrznym edytorze"
#: src/config/actions-edit.inc:26
#: src/config/actions-edit.inc:29
msgid "Paste text from the clipboard"
msgstr "Wstaw tekst ze schowka"
#: src/config/actions-edit.inc:27 src/config/actions-menu.inc:20
#: src/config/actions-edit.inc:30 src/config/actions-menu.inc:20
msgid "Move to the previous item"
msgstr "Przesuñ do poprzedniej pozycji"
#: src/config/actions-edit.inc:28 src/config/actions-main.inc:79
#: src/config/actions-edit.inc:31 src/config/actions-main.inc:79
#: src/config/actions-menu.inc:21
msgid "Redraw the terminal"
msgstr "Odrysuj terminal"
#: src/config/actions-edit.inc:29 src/config/actions-menu.inc:22
#: src/config/actions-edit.inc:32 src/config/actions-menu.inc:22
msgid "Move the cursor right"
msgstr "Przesuñ kursor w prawo"
#: src/config/actions-edit.inc:30
#: src/config/actions-edit.inc:33
msgid "Toggle regex matching (type-ahead searching)"
msgstr "Prze³±cz szukanie wyra¿eñ regularnych (szukanie z wyprzedzeniem)"
#: src/config/actions-edit.inc:31 src/config/actions-menu.inc:26
#: src/config/actions-edit.inc:34 src/config/actions-menu.inc:26
msgid "Move cursor upwards"
msgstr "Przesuñ kursor w górê"
@ -3265,7 +3277,7 @@ msgid "Dump output options."
msgstr "Ustawienia dotycz±ce zrzutów."
#: src/config/options.inc:630 src/config/options.inc:879
#: src/config/opttypes.c:394 src/dialogs/document.c:163
#: src/config/opttypes.c:407 src/dialogs/document.c:163
msgid "Codepage"
msgstr "Strona kodowa"
@ -3958,7 +3970,7 @@ msgstr "Tekst"
msgid "Dialog text colors."
msgstr "Kolory tekstu w oknie dialogowym."
#: src/config/options.inc:1026 src/viewer/text/form.c:1458
#: src/config/options.inc:1026 src/viewer/text/form.c:1503
msgid "Checkbox"
msgstr "Przycisk wyboru"
@ -4010,7 +4022,7 @@ msgstr "Klawisz skr
msgid "Selected button shortcut"
msgstr "Klawisz skrótu wybranego przycisku"
#: src/config/options.inc:1054 src/viewer/text/form.c:1462
#: src/config/options.inc:1054 src/viewer/text/form.c:1507
msgid "Text field"
msgstr "Pole tekstowe"
@ -4325,7 +4337,7 @@ msgstr "Potwierdzenie zamkni
msgid "When closing a tab show confirmation dialog."
msgstr "Przy zamykaniu karty pokazuj okienko dialogowe potwierdzania."
#: src/config/options.inc:1217 src/config/opttypes.c:395
#: src/config/options.inc:1217 src/config/opttypes.c:408
msgid "Language"
msgstr "Jêzyk"
@ -4491,62 +4503,62 @@ msgstr ""
msgid "Read error"
msgstr "B³±d odczytu"
#: src/config/opttypes.c:389
#: src/config/opttypes.c:402
msgid "Boolean"
msgstr "Typ boolowski"
#: src/config/opttypes.c:389
#: src/config/opttypes.c:402
msgid "[0|1]"
msgstr "[0|1]"
#: src/config/opttypes.c:390
#: src/config/opttypes.c:403
msgid "Integer"
msgstr "Liczba ca³kowita"
#: src/config/opttypes.c:390 src/config/opttypes.c:391
#: src/config/opttypes.c:403 src/config/opttypes.c:404
msgid "<num>"
msgstr "<liczba>"
#: src/config/opttypes.c:391
#: src/config/opttypes.c:404
msgid "Longint"
msgstr "Du¿a liczba ca³kowita"
#: src/config/opttypes.c:392
#: src/config/opttypes.c:405
msgid "String"
msgstr "Napis"
#: src/config/opttypes.c:392
#: src/config/opttypes.c:405
msgid "<str>"
msgstr "<³añcuch>"
#
#: src/config/opttypes.c:394
#: src/config/opttypes.c:407
msgid "<codepage>"
msgstr "<strona kodowa>"
#
#: src/config/opttypes.c:395
#: src/config/opttypes.c:408
msgid "<language>"
msgstr "<jêzyk>"
#: src/config/opttypes.c:396
#: src/config/opttypes.c:409
msgid "Color"
msgstr "Kolor"
#: src/config/opttypes.c:396
#: src/config/opttypes.c:409
msgid "<color|#rrggbb>"
msgstr "<kolor|#rrggbb>"
#: src/config/opttypes.c:398
#: src/config/opttypes.c:411
msgid "Special"
msgstr "Specjalny"
#: src/config/opttypes.c:400
#: src/config/opttypes.c:413
msgid "Alias"
msgstr "Alias"
#. tree
#: src/config/opttypes.c:403
#: src/config/opttypes.c:416
msgid "Folder"
msgstr "Folder"
@ -6157,7 +6169,7 @@ msgstr "Turecki"
msgid "Ukrainian"
msgstr "Ukraiñski"
#: src/main/interlink.c:329 src/main/select.c:255
#: src/main/interlink.c:329 src/main/select.c:257
#, c-format
msgid "The call to %s failed: %d (%s)"
msgstr "Wywo³anie %s nieudane: %d (%s)"
@ -6189,7 +6201,7 @@ msgid "Unable to attach_terminal()."
msgstr "Nie jestem w stanie przy³±czyæ terminala."
#. Infinite loop prevention.
#: src/main/select.c:258
#: src/main/select.c:260
#, c-format
msgid "%d select() failures."
msgstr "%d b³êdów select()."
@ -8238,15 +8250,15 @@ msgstr "B
msgid "User dialog"
msgstr "Okno dialogowe u¿ytkownika"
#: src/scripting/lua/core.c:726
#: src/scripting/lua/core.c:730
msgid "Lua Error"
msgstr "B³±d Lua"
#: src/scripting/lua/core.c:876
#: src/scripting/lua/core.c:880
msgid "Lua Console"
msgstr "Konsola Lua"
#: src/scripting/lua/core.c:876
#: src/scripting/lua/core.c:880
msgid "Enter expression"
msgstr "Wprowad¼ wyra¿enie"
@ -8537,81 +8549,81 @@ msgstr "Wyst
msgid "Could not load file %s: %s"
msgstr "Nie mo¿na wczytaæ pliku %s: %s"
#: src/viewer/text/form.c:1443
#: src/viewer/text/form.c:1488
msgid "Reset form"
msgstr "Wyczy¶æ formularz"
#
#: src/viewer/text/form.c:1445
#: src/viewer/text/form.c:1490
msgid "Harmless button"
msgstr "Nieszkodliwy przycisk"
#: src/viewer/text/form.c:1453
#: src/viewer/text/form.c:1498
msgid "Submit form to"
msgstr "Prze¶lij formularz do"
#: src/viewer/text/form.c:1454
#: src/viewer/text/form.c:1499
msgid "Post form to"
msgstr "Wy¶lij formularz do"
#: src/viewer/text/form.c:1456
#: src/viewer/text/form.c:1501
msgid "Radio button"
msgstr "Okr±g³y przycisk"
#: src/viewer/text/form.c:1460
#: src/viewer/text/form.c:1505
msgid "Select field"
msgstr "Pole wyboru"
#: src/viewer/text/form.c:1464
#: src/viewer/text/form.c:1509
msgid "Text area"
msgstr "Pole tekstowe"
#: src/viewer/text/form.c:1466
#: src/viewer/text/form.c:1511
msgid "File upload"
msgstr "£adowanie pliku"
#: src/viewer/text/form.c:1468
#: src/viewer/text/form.c:1513
msgid "Password field"
msgstr "Pole has³a"
#: src/viewer/text/form.c:1506
#: src/viewer/text/form.c:1551
msgid "name"
msgstr "nazwa"
#: src/viewer/text/form.c:1518
#: src/viewer/text/form.c:1563
msgid "value"
msgstr "warto¶æ"
#: src/viewer/text/form.c:1531
#: src/viewer/text/form.c:1576
msgid "read only"
msgstr "tylko do odczytu"
#: src/viewer/text/form.c:1542
#: src/viewer/text/form.c:1587
#, c-format
msgid "press %s to navigate"
msgstr "wci¶nij %s aby nawigowaæ"
#: src/viewer/text/form.c:1544
#: src/viewer/text/form.c:1589
#, c-format
msgid "press %s to edit"
msgstr "wci¶nij %s aby edytowaæ"
#: src/viewer/text/form.c:1580
#: src/viewer/text/form.c:1625
#, c-format
msgid "press %s to submit to %s"
msgstr "wci¶nij %s aby wys³aæ do %s"
#: src/viewer/text/form.c:1582
#: src/viewer/text/form.c:1627
#, c-format
msgid "press %s to post to %s"
msgstr "wci¶nij %s aby wys³aæ do %s"
#
#: src/viewer/text/form.c:1684
#: src/viewer/text/form.c:1729
msgid "Useless button"
msgstr "Bezu¿yteczny przycisk"
#: src/viewer/text/form.c:1686
#: src/viewer/text/form.c:1731
msgid "Submit button"
msgstr "Przycisk wys³ania formularza"
@ -8818,19 +8830,19 @@ msgstr ""
"Wej¶cie zosta³o obciête, ale mo¿na nadal odzyskaæ wpisany tekst z tego "
"pliku: %s"
#: src/viewer/text/view.c:721
#: src/viewer/text/view.c:715
msgid "Go to link"
msgstr "Przejd¼ do odno¶nika"
#: src/viewer/text/view.c:721
#: src/viewer/text/view.c:715
msgid "Enter link number"
msgstr "Wprowad¼ numer odno¶nika"
#: src/viewer/text/view.c:1304
#: src/viewer/text/view.c:1299
msgid "Save error"
msgstr "B³±d zapisu"
#: src/viewer/text/view.c:1305
#: src/viewer/text/view.c:1300
msgid "Error writing to file"
msgstr "B³±d zapisu do pliku"

View File

@ -33,13 +33,12 @@ BUILD_ID=$(shell GIT_DIR=$(top_srcdir)/.git $(CG_COMMIT_ID) 2> /dev/null)
endif
INCLUDES += -DBUILD_ID="\"$(BUILD_ID)\""
OBJS = vernum.o
vernum.o: FORCE
FORCE:
vernum.o: $(LIB_O_NAME)
elinks: $(LIB_O_NAME)
elinks: $(LIB_O_NAME) vernum.o
$(call cmd,link)
PROGS = elinks
CLEAN = vernum.o
include $(top_srcdir)/Makefile.lib

2
src/cache/cache.c vendored
View File

@ -694,7 +694,7 @@ redirect_cache(struct cache_entry *cached, unsigned char *location,
/* XXX: We are assuming here that incomplete will only be zero when
* doing these fake redirects which only purpose is to add an ending
* slash *cough* dirseparator to the end of the URI. */
if (incomplete == 0 && location[0] == '/' && location[1] == 0) {
if (incomplete == 0 && dir_sep(location[0]) && location[1] == 0) {
/* To be sure use get_uri_string() to get rid of post data */
uristring = get_uri_string(cached->uri, URI_ORIGINAL);
if (uristring) add_to_strn(&uristring, location);

View File

@ -500,13 +500,13 @@ load_config_file(unsigned char *prefix, unsigned char *name,
{
unsigned char *config_str, *config_file;
config_file = straconcat(prefix, "/", name, NULL);
config_file = straconcat(prefix, STRING_DIR_SEP, name, NULL);
if (!config_file) return 1;
config_str = read_config_file(config_file);
if (!config_str) {
mem_free(config_file);
config_file = straconcat(prefix, "/.", name, NULL);
config_file = straconcat(prefix, STRING_DIR_SEP, ".", name, NULL);
if (!config_file) return 2;
config_str = read_config_file(config_file);
@ -796,7 +796,7 @@ write_config_file(unsigned char *prefix, unsigned char *name,
int prefixlen = strlen(prefix);
int prefix_has_slash = (prefixlen && dir_sep(prefix[prefixlen - 1]));
int name_has_slash = dir_sep(name[0]);
unsigned char *slash = name_has_slash || prefix_has_slash ? "" : "/";
unsigned char *slash = name_has_slash || prefix_has_slash ? "" : STRING_DIR_SEP;
if (!cfg_str) return -1;

View File

@ -49,7 +49,7 @@ test_confdir(unsigned char *home, unsigned char *path,
if (!path || !*path) return NULL;
if (home && *home && !dir_sep(*path))
confdir = straconcat(home, "/", path, NULL);
confdir = straconcat(home, STRING_DIR_SEP, path, NULL);
else
confdir = stracpy(path);
@ -134,7 +134,7 @@ get_home(void)
end:
if (home_elinks)
add_to_strn(&home_elinks, "/");
add_to_strn(&home_elinks, STRING_DIR_SEP);
mem_free_if(home);
return home_elinks;

View File

@ -449,7 +449,7 @@ init_option_listbox_item(struct option *option)
struct option *
add_opt(struct option *tree, unsigned char *path, unsigned char *capt,
unsigned char *name, enum option_flags flags, enum option_type type,
long min, long max, void *value, unsigned char *desc)
long min, long max, longptr_T value, unsigned char *desc)
{
struct option *option = mem_calloc(1, sizeof(*option));
@ -477,17 +477,17 @@ add_opt(struct option *tree, unsigned char *path, unsigned char *capt,
mem_free(option);
return NULL;
}
option->value.tree = value;
option->value.tree = (struct list_head *) value;
break;
case OPT_STRING:
if (!value) {
mem_free(option);
return NULL;
}
option->value.string = value;
option->value.string = (unsigned char *) value;
break;
case OPT_ALIAS:
option->value.string = value;
option->value.string = (unsigned char *) value;
break;
case OPT_BOOL:
case OPT_INT:
@ -498,11 +498,11 @@ add_opt(struct option *tree, unsigned char *path, unsigned char *capt,
option->value.big_number = (long) value; /* FIXME: cast from void * */
break;
case OPT_COLOR:
decode_color(value, strlen((unsigned char *) value),
decode_color((unsigned char *) value, strlen((unsigned char *) value),
&option->value.color);
break;
case OPT_COMMAND:
option->value.command = value;
option->value.command = (void *) value;
break;
case OPT_LANGUAGE:
break;

View File

@ -233,7 +233,7 @@ extern union option_value *get_opt_(struct option *, unsigned char *);
extern struct option *add_opt(struct option *, unsigned char *, unsigned char *,
unsigned char *, enum option_flags, enum option_type,
long, long, void *, unsigned char *);
long, long, longptr_T, unsigned char *);
/* Hack which permit to disable option descriptions, to reduce elinks binary size.
* It may of some use for people wanting a very small static non-i18n elinks binary,
@ -246,38 +246,38 @@ extern struct option *add_opt(struct option *, unsigned char *, unsigned char *,
#define add_opt_bool_tree(tree, path, capt, name, flags, def, desc) \
add_opt(tree, path, capt, name, flags, OPT_BOOL, 0, 1, (void *) def, DESC(desc))
add_opt(tree, path, capt, name, flags, OPT_BOOL, 0, 1, (longptr_T) def, DESC(desc))
#define add_opt_int_tree(tree, path, capt, name, flags, min, max, def, desc) \
add_opt(tree, path, capt, name, flags, OPT_INT, min, max, (void *) def, DESC(desc))
add_opt(tree, path, capt, name, flags, OPT_INT, min, max, (longptr_T) def, DESC(desc))
#define add_opt_long_tree(tree, path, capt, name, flags, min, max, def, desc) \
add_opt(tree, path, capt, name, flags, OPT_LONG, min, max, (void *) def, DESC(desc))
add_opt(tree, path, capt, name, flags, OPT_LONG, min, max, (longptr_T) def, DESC(desc))
#define add_opt_str_tree(tree, path, capt, name, flags, def, desc) \
do { \
unsigned char *ptr = mem_alloc(MAX_STR_LEN); \
safe_strncpy(ptr, def, MAX_STR_LEN); \
add_opt(tree, path, capt, name, flags, OPT_STRING, 0, MAX_STR_LEN, ptr, DESC(desc)); \
add_opt(tree, path, capt, name, flags, OPT_STRING, 0, MAX_STR_LEN, (longptr_T) ptr, DESC(desc)); \
} while (0)
#define add_opt_codepage_tree(tree, path, capt, name, flags, def, desc) \
add_opt(tree, path, capt, name, flags, OPT_CODEPAGE, 0, 0, (void *) get_cp_index(def), DESC(desc))
add_opt(tree, path, capt, name, flags, OPT_CODEPAGE, 0, 0, (longptr_T) get_cp_index(def), DESC(desc))
#define add_opt_lang_tree(tree, path, capt, name, flags, desc) \
add_opt(tree, path, capt, name, flags, OPT_LANGUAGE, 0, 0, NULL, DESC(desc))
add_opt(tree, path, capt, name, flags, OPT_LANGUAGE, 0, 0, (longptr_T) 0, DESC(desc))
#define add_opt_color_tree(tree, path, capt, name, flags, def, desc) \
add_opt(tree, path, capt, name, flags, OPT_COLOR, 0, 0, def, DESC(desc))
add_opt(tree, path, capt, name, flags, OPT_COLOR, 0, 0, (longptr_T) def, DESC(desc))
#define add_opt_command_tree(tree, path, capt, name, flags, cmd, desc) \
add_opt(tree, path, capt, name, flags, OPT_COMMAND, 0, 0, cmd, DESC(desc));
add_opt(tree, path, capt, name, flags, OPT_COMMAND, 0, 0, (longptr_T) cmd, DESC(desc));
#define add_opt_alias_tree(tree, path, capt, name, flags, def, desc) \
add_opt(tree, path, capt, name, flags, OPT_ALIAS, 0, strlen(def), def, DESC(desc))
add_opt(tree, path, capt, name, flags, OPT_ALIAS, 0, strlen(def), (longptr_T) def, DESC(desc))
#define add_opt_tree_tree(tree, path, capt, name, flags, desc) \
add_opt(tree, path, capt, name, flags, OPT_TREE, 0, 0, init_options_tree(), DESC(desc));
add_opt(tree, path, capt, name, flags, OPT_TREE, 0, 0, (longptr_T) init_options_tree(), DESC(desc));
/* Builtin options */

View File

@ -262,6 +262,36 @@ html_skip(struct html_context *html_context, unsigned char *a)
html_top->type = ELEMENT_DONT_KILL;
}
/* Parse meta refresh without URL= in it:
* <meta http-equiv="refresh" content="3,http://elinks.or.cz/">
* <meta http-equiv="refresh" content="3; http://elinks.or.cz/">
* <meta http-equiv="refresh" content=" 3 ; http://elinks.or.cz/ ">
*/
static void
parse_old_meta_refresh(unsigned char *str, unsigned char **ret)
{
unsigned char *p = str;
int len;
assert(str && ret);
if_assert_failed return;
*ret = NULL;
while (*p && (*p == ' ' || *p == ASCII_TAB)) p++;
if (!*p) return;
while (*p && *p >= '0' && *p <= '9') p++;
if (!*p) return;
while (*p && (*p == ' ' || *p == ASCII_TAB)) p++;
if (!*p) return;
if (*p == ';' || *p == ',') p++; else return;
while (*p && (*p == ' ' || *p == ASCII_TAB)) p++;
if (!*p) return;
len = strlen(p);
while (len && (p[len] == ' ' || p[len] == ASCII_TAB)) len--;
if (len) *ret = memacpy(p, len);
}
void
process_head(struct html_context *html_context, unsigned char *head)
{
@ -272,9 +302,13 @@ process_head(struct html_context *html_context, unsigned char *head)
parse_header_param(refresh, "URL", &url);
if (!url) {
/* If the URL parameter is missing assume that the
* document being processed should be refreshed. */
url = get_uri_string(html_context->base_href, URI_ORIGINAL);
/* Let's try a more tolerant parsing. */
parse_old_meta_refresh(refresh, &url);
if (!url) {
/* If the URL parameter is missing assume that the
* document being processed should be refreshed. */
url = get_uri_string(html_context->base_href, URI_ORIGINAL);
}
}
if (url) {

View File

@ -16,6 +16,7 @@
#include "ecmascript/spidermonkey.h"
#include "intl/gettext/libintl.h"
#include "main/module.h"
#include "osdep/osdep.h"
#include "protocol/protocol.h"
#include "protocol/uri.h"
#include "session/session.h"
@ -274,7 +275,7 @@ ecmascript_set_action(unsigned char **action, unsigned char *string)
done_uri(protocol);
mem_free_set(action, string);
} else {
if (string[0] == '/') { /* absolute uri */
if (dir_sep(string[0])) { /* absolute uri, TODO: disk drive under WIN32 */
struct uri *uri = get_uri(*action, URI_HTTP_REFERRER_HOST);
if (uri->protocol == PROTOCOL_FILE) {

View File

@ -7,6 +7,14 @@
#include "osdep/unix/unix.h"
#include "osdep/win32/win32.h"
#ifndef CHAR_DIR_SEP
#define CHAR_DIR_SEP '/'
#endif
#ifndef STRING_DIR_SEP
#define STRING_DIR_SEP "/"
#endif
int get_system_env(void);
int get_e(unsigned char *env);
int is_xterm(void);

View File

@ -118,4 +118,10 @@ typedef unsigned long long uint32_t;
#define __SHRT_MAX__ 0x7fff
#endif
/*
* long l; (long) (longptr_T) l == l
* void *p; (void *) (longptr_T) p == p
*/
typedef long longptr_T;
#endif

View File

@ -60,6 +60,21 @@ static const char *keymap[] = {
"\E[3~" /* VK_DELETE */
};
static const char *keymap_2[] = {
"\E[11~", /* VK_F1 */
"\E[12~", /* VK_F2 */
"\E[13~", /* VK_F3 */
"\E[14~", /* VK_F4 */
"\E[15~", /* VK_F5 */
"\E[17~", /* VK_F6 */
"\E[18~", /* VK_F7 */
"\E[19~", /* VK_F8 */
"\E[20~", /* VK_F9 */
"\E[21~", /* VK_F10 */
"\E[23~", /* VK_F11 */
"\E[24~" /* VK_F12 */
};
#define TRACE(m...) \
do { \
if (get_cmd_opt_int("verbose") == 2) \
@ -101,11 +116,15 @@ console_key_read(const KEY_EVENT_RECORD *ker, char *buf, int max)
}
vkey = ker->wVirtualKeyCode;
if (vkey < VK_PRIOR || vkey > VK_DELETE)
return 0;
strncpy(buf, keymap[vkey-VK_PRIOR], max);
if (vkey >= VK_PRIOR && vkey <= VK_DELETE) {
strncpy(buf, keymap[vkey - VK_PRIOR], max);
} else {
if (vkey >= VK_F1 && vkey <= VK_F12) {
strncpy(buf, keymap_2[vkey - VK_F1], max);
} else {
return 0;
}
}
return strlen(buf);
}

View File

@ -4,6 +4,11 @@
#ifdef CONFIG_OS_WIN32
#undef CHAR_DIR_SEP
#define CHAR_DIR_SEP '\\'
#undef STRING_DIR_SEP
#define STRING_DIR_SEP "\\"
struct terminal;
void open_in_new_win32(struct terminal *term, unsigned char *exe_name,

View File

@ -23,7 +23,7 @@ convert_to_md5_digest_hex_T(md5_digest_bin_T bin, md5_digest_hex_T hex)
{
int i;
for (i = 0; i < sizeof(bin); i++) {
for (i = 0; i < sizeof(md5_digest_bin_T); i++) {
int j = i * 2;
hex[j] = hx(bin[i] >> 4 & 0xF);
@ -108,18 +108,18 @@ init_response_digest(md5_digest_hex_T response, struct auth_entry *entry,
init_uri_method_digest(Ha2_hex, uri);
MD5_Init(&MD5Ctx);
MD5_Update(&MD5Ctx, ha1, sizeof(ha1));
MD5_Update(&MD5Ctx, ha1, sizeof(md5_digest_hex_T));
MD5_Update(&MD5Ctx, ":", 1);
if (entry->nonce)
MD5_Update(&MD5Ctx, entry->nonce, strlen(entry->nonce));
MD5_Update(&MD5Ctx, ":", 1);
MD5_Update(&MD5Ctx, "00000001", 8);
MD5_Update(&MD5Ctx, ":", 1);
MD5_Update(&MD5Ctx, cnonce, sizeof(cnonce));
MD5_Update(&MD5Ctx, cnonce, sizeof(md5_digest_hex_T));
MD5_Update(&MD5Ctx, ":", 1);
MD5_Update(&MD5Ctx, "auth", 4);
MD5_Update(&MD5Ctx, ":", 1);
MD5_Update(&MD5Ctx, Ha2_hex, sizeof(Ha2_hex));
MD5_Update(&MD5Ctx, Ha2_hex, sizeof(md5_digest_hex_T));
MD5_Final(Ha2, &MD5Ctx);
convert_to_md5_digest_hex_T(Ha2, response);
@ -155,10 +155,10 @@ get_http_auth_digest_response(struct auth_entry *entry, struct uri *uri)
add_to_string(&string, "\", ");
add_to_string(&string, "qop=auth, nc=00000001, ");
add_to_string(&string, "cnonce=\"");
add_bytes_to_string(&string, cnonce, sizeof(cnonce));
add_bytes_to_string(&string, cnonce, sizeof(md5_digest_hex_T));
add_to_string(&string, "\", ");
add_to_string(&string, "response=\"");
add_bytes_to_string(&string, response, sizeof(response));
add_bytes_to_string(&string, response, sizeof(md5_digest_hex_T));
add_to_string(&string, "\"");
if (entry->opaque) {

View File

@ -18,6 +18,7 @@
#include "elinks.h"
#include "config/options.h"
#include "osdep/osdep.h"
#include "protocol/common.h"
#include "protocol/protocol.h"
#include "protocol/uri.h"
@ -59,7 +60,7 @@ init_directory_listing(struct string *page, struct uri *uri)
if (dirpath.length > 0
&& !dir_sep(dirpath.source[dirpath.length - 1])
&& !add_char_to_string(&dirpath, '/'))
&& !add_char_to_string(&dirpath, local ? CHAR_DIR_SEP : '/'))
goto out_of_memory;
if (local || uri->protocol == PROTOCOL_GOPHER) {
@ -82,7 +83,14 @@ init_directory_listing(struct string *page, struct uri *uri)
|| !add_string_to_string(page, &location))
goto out_of_memory;
encode_uri_string(page, dirpath.source, -1, 0);
#ifdef CONFIG_OS_WIN32
/* Stupid. ':' and '\\' are encoded and base href with them
* doesn't "work". */
if (local)
encode_win32_uri_string(page, dirpath.source, dirpath.length);
else
#endif
encode_uri_string(page, dirpath.source, dirpath.length, 0);
if (!add_to_string(page, "\" />\n</head>\n<body>\n<h2>"))
goto out_of_memory;
@ -116,15 +124,18 @@ init_directory_listing(struct string *page, struct uri *uri)
{
unsigned char *slash = dirpath.source;
unsigned char *pslash = slash;
unsigned char sep = local ? CHAR_DIR_SEP : '/';
while ((slash = strchr(slash, '/'))) {
while ((slash = strchr(slash, sep))) {
/* FIXME: htmlesc? At least we should escape quotes. --pasky */
if (!add_to_string(page, "<a href=\"")
|| !add_string_to_string(page, &location)
|| !add_bytes_to_string(page, dirpath.source, slash - dirpath.source)
|| !add_to_string(page, "/\">")
|| !add_char_to_string(page, sep)
|| !add_to_string(page, "\">")
|| !add_html_to_string(page, pslash, slash - pslash)
|| !add_to_string(page, "</a>/"))
|| !add_to_string(page, "</a>")
|| !add_char_to_string(page, sep))
goto out_of_memory;
pslash = ++slash;

View File

@ -26,6 +26,7 @@
#include "main/module.h"
#include "network/connection.h"
#include "network/socket.h"
#include "osdep/osdep.h"
#include "protocol/common.h"
#include "protocol/file/cgi.h"
#include "protocol/file/file.h"
@ -101,7 +102,7 @@ add_dir_entry(struct directory_entry *entry, struct string *page,
add_string_to_string(page, &uri_encoded_name);
if (entry->attrib[0] == 'd') {
add_char_to_string(page, '/');
add_char_to_string(page, CHAR_DIR_SEP);
#ifdef FS_UNIX_SOFTLINKS
} else if (entry->attrib[0] == 'l') {
@ -274,7 +275,7 @@ file_protocol_handler(struct connection *connection)
* function properly the directory url must end with a
* directory separator. */
if (name.source[0] && !dir_sep(name.source[name.length - 1])) {
redirect_location = "/";
redirect_location = STRING_DIR_SEP;
state = S_OK;
} else {
state = list_directory(connection, name.source, &page);

View File

@ -568,6 +568,9 @@ add_uri_to_string(struct string *string, struct uri *uri,
"URI_FILENAME should be used alone %d", components);
if (wants(URI_PATH) && !is_uri_dir_sep(uri, *filename)) {
#ifdef CONFIG_OS_WIN32
if (uri->protocol != PROTOCOL_FILE)
#endif
/* FIXME: Add correct separator */
add_char_to_string(string, '/');
}
@ -1334,6 +1337,29 @@ encode_uri_string(struct string *string, unsigned char *name, int namelen,
}
}
void
encode_win32_uri_string(struct string *string, unsigned char *name, int namelen)
{
unsigned char n[4];
unsigned char *end;
n[0] = '%';
n[3] = '\0';
if (namelen < 0) namelen = strlen(name);
for (end = name + namelen; name < end; name++) {
if (safe_char(*name) || *name == ':' || *name == '\\') {
add_char_to_string(string, *name);
} else {
/* Hex it. */
n[1] = hx((((int) *name) & 0xF0) >> 4);
n[2] = hx(((int) *name) & 0xF);
add_bytes_to_string(string, n, sizeof(n) - 1);
}
}
}
/* This function is evil, it modifies its parameter. */
/* XXX: but decoded string is _never_ longer than encoded string so it's an
* efficient way to do that, imho. --Zas */

View File

@ -281,6 +281,9 @@ int get_uri_port(struct uri *uri);
void encode_uri_string(struct string *string, unsigned char *name, int namelen,
int convert_slashes);
/* special version for Windows directory listing */
void encode_win32_uri_string(struct string *string, unsigned char *name, int namelen);
void decode_uri_string(struct string *string);
void decode_uri(unsigned char *uristring);

View File

@ -30,6 +30,7 @@
#include "intl/gettext/libintl.h"
#include "main/event.h"
#include "main/module.h"
#include "osdep/osdep.h"
#include "osdep/signals.h"
#include "protocol/uri.h"
#include "scripting/lua/core.h"
@ -630,7 +631,7 @@ 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, "/", filename, NULL);
unsigned char *file = straconcat(prefix, STRING_DIR_SEP, filename, NULL);
if (!file) return;

View File

@ -11,6 +11,7 @@
#include "config/home.h"
#include "main/module.h"
#include "osdep/osdep.h"
#include "scripting/perl/core.h"
#include "util/file.h"
@ -27,7 +28,7 @@ extern char **environ;
static char *
get_global_hook_file(void)
{
static char buf[] = CONFDIR "/" PERL_HOOKS_FILENAME;
static char buf[] = CONFDIR STRING_DIR_SEP PERL_HOOKS_FILENAME;
if (file_exists(buf)) return buf;
return NULL;

View File

@ -14,6 +14,7 @@
#include "config/home.h"
#include "intl/gettext/libintl.h"
#include "main/module.h"
#include "osdep/osdep.h"
#include "scripting/scripting.h"
#include "scripting/ruby/core.h"
#include "scripting/ruby/ruby.h"
@ -235,7 +236,7 @@ init_ruby(struct module *module)
path = straconcat(elinks_home, RUBY_HOOKS_FILENAME, NULL);
} else {
path = stracpy(CONFDIR "/" RUBY_HOOKS_FILENAME);
path = stracpy(CONFDIR STRING_DIR_SEP RUBY_HOOKS_FILENAME);
}
if (!path) return;

View File

@ -9,6 +9,7 @@
#include "config/home.h"
#include "ecmascript/spidermonkey/util.h"
#include "main/module.h"
#include "osdep/osdep.h"
#include "scripting/scripting.h"
#include "scripting/smjs/core.h"
#include "scripting/smjs/elinks_object.h"
@ -114,7 +115,7 @@ smjs_load_hooks(void)
if (elinks_home) {
path = straconcat(elinks_home, SMJS_HOOKS_FILENAME, NULL);
} else {
path = stracpy(CONFDIR "/" SMJS_HOOKS_FILENAME);
path = stracpy(CONFDIR STRING_DIR_SEP SMJS_HOOKS_FILENAME);
}
if (file_exists(path))

View File

@ -75,6 +75,8 @@ disable_mouse(void)
{
int h = get_output_handle(); /* XXX: Is this all right? -- Miciah */
if (!mouse_enabled) return;
unhandle_mouse(ditrm->mouse_h);
if (is_xterm()) send_mouse_done_sequence(h);
@ -86,6 +88,8 @@ enable_mouse(void)
{
int h = get_output_handle(); /* XXX: Is this all right? -- Miciah */
if (mouse_enabled) return;
if (is_xterm()) send_mouse_init_sequence(h);
ditrm->mouse_h = handle_mouse(0, (void (*)(void *, unsigned char *, int)) itrm_queue_event, ditrm);