diff -Nurp links-1.00pre6/BUGS links-1.00pre7/BUGS --- links-1.00pre6/BUGS 2002-03-27 01:04:26.000000000 +0100 +++ links-1.00pre7/BUGS 2004-06-17 20:46:51.000000000 +0200 @@ -5,6 +5,4 @@ case. You can't upload large files; it takes _lots_ of memory. -You shouldn't press '^Z' when you are in a viewer - vim: textwidth=80 diff -Nurp links-1.00pre6/ChangeLog links-1.00pre7/ChangeLog --- links-1.00pre6/ChangeLog 2004-06-17 20:26:49.000000000 +0200 +++ links-1.00pre7/ChangeLog 2004-06-20 14:51:59.000000000 +0200 @@ -1,3 +1,14 @@ +=== RELEASE 1.00pre7 === + +Sat Jun 19 18:10:33 MET 2004 user: + + Fixed case when '&' entities or special characters were in ftp or disk + filenames + +Sat Jun 19 16:47:20 MET 2004 user: + + Fixed compilation problem on AIX + === RELEASE 1.00pre6 === Thu Jun 17 20:26:24 MET DST 2004 mikulas: diff -Nurp links-1.00pre6/config2.h links-1.00pre7/config2.h --- links-1.00pre6/config2.h 2004-06-17 20:37:48.000000000 +0200 +++ links-1.00pre7/config2.h 2004-06-20 13:38:26.000000000 +0200 @@ -5,7 +5,7 @@ #define PACKAGE "links" /* Version number of package */ -#define VERSION "1.00pre6" +#define VERSION "1.00pre7" /* Define to empty if the keyword does not work. */ /* #undef const */ diff -Nurp links-1.00pre6/configure links-1.00pre7/configure --- links-1.00pre6/configure 2004-06-17 20:41:11.000000000 +0200 +++ links-1.00pre7/configure 2004-06-20 13:39:11.000000000 +0200 @@ -694,7 +694,7 @@ fi PACKAGE=links -VERSION=1.00pre6 +VERSION=1.00pre7 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } diff -Nurp links-1.00pre6/configure.in links-1.00pre7/configure.in --- links-1.00pre6/configure.in 2004-06-17 20:37:43.000000000 +0200 +++ links-1.00pre7/configure.in 2004-06-20 13:38:21.000000000 +0200 @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(main.c) -AM_INIT_AUTOMAKE(links, 1.00pre6) +AM_INIT_AUTOMAKE(links, 1.00pre7) AM_CONFIG_HEADER(config.h) dnl Checks for programs. diff -Nurp links-1.00pre6/file.c links-1.00pre7/file.c --- links-1.00pre6/file.c 2003-12-18 16:20:29.000000000 +0100 +++ links-1.00pre7/file.c 2004-06-19 18:05:33.000000000 +0200 @@ -255,9 +255,9 @@ void file_func(struct connection *c) file = init_str(); fl = 0; add_to_str(&file, &fl, ""); - add_to_str(&file, &fl, name); + add_conv_str(&file, &fl, name, strlen(name)); add_to_str(&file, &fl, "

Directory "); - add_to_str(&file, &fl, name); + add_conv_str(&file, &fl, name, strlen(name)); add_to_str(&file, &fl, "

");
 		while ((de = readdir(d))) {
 			struct stat stt, *stp;
@@ -319,7 +319,7 @@ void file_func(struct connection *c)
 			/*add_to_str(&file, &fl, "   ");*/
 			add_to_str(&file, &fl, dir[i].s);
 			add_to_str(&file, &fl, "");
 			/*if (dir[i].s[0] == 'd') add_to_str(&file, &fl, "");*/
-			add_to_str(&file, &fl, dir[i].f);
+			add_conv_str(&file, &fl, dir[i].f, strlen(dir[i].f));
 			/*if (dir[i].s[0] == 'd') add_to_str(&file, &fl, "");*/
 			add_to_str(&file, &fl, "");
 			if (lnk) {
diff -Nurp links-1.00pre6/ftp.c links-1.00pre7/ftp.c
--- links-1.00pre6/ftp.c	2004-06-03 22:37:19.000000000 +0200
+++ links-1.00pre7/ftp.c	2004-06-19 18:05:20.000000000 +0200
@@ -519,20 +519,6 @@ void ftp_got_final_response(struct conne
 	}
 }
 
-#define accept_char(x)  ((unsigned char)x >= ' ' && x != '"' && x != '&' && x != '/' && x != '<' && x != '>')
-
-void add_conv_str(unsigned char **s, int *l, unsigned char *b, int ll)
-{
-	for (; ll; ll--, b++) {
-		if (accept_char(*b)) add_chr_to_str(s, l, *b);
-		else {
-			add_to_str(s, l, "&#");
-			add_num_to_str(s, l, (int)*b);
-			add_chr_to_str(s, l, ';');
-		}
-	}
-}
-
 int ftp_process_dirlist(struct cache_entry *ce, int *pos, int *d, unsigned char *bf, int ln, int fin, int *tr)
 {
 	unsigned char *str, *buf;
@@ -637,6 +623,8 @@ void got_something_from_data_connection(
 	}
 	if (inf->dir && !c->from) {
 		unsigned char *ud;
+		unsigned char *s0;
+		int s0l;
 		static unsigned char ftp_head[] = "/";
 		static unsigned char ftp_head2[] = "

Directory /"; static unsigned char ftp_head3[] = "

";
@@ -644,11 +632,15 @@ void got_something_from_data_connection(
 		A(ftp_head);
 		ud = stracpy(get_url_data(c->url));
 		if (strchr(ud, POST_CHAR)) *strchr(ud, POST_CHAR) = 0;
-		if (ud) A(ud);
+		s0 = init_str();
+		s0l = 0;
+		add_conv_str(&s0, &s0l, ud, strlen(ud));
+		mem_free(ud);
+		A(s0);
 		A(ftp_head2);
-		if (ud) A(ud);
+		A(s0);
 		A(ftp_head3);
-		if (ud) mem_free(ud);
+		mem_free(s0);
 		if (!c->cache->head) c->cache->head = stracpy("\r\n");
 		add_to_strn(&c->cache->head, "Content-Type: text/html\r\n");
 #undef A
diff -Nurp links-1.00pre6/links.h links-1.00pre7/links.h
--- links-1.00pre6/links.h	2004-02-24 22:40:30.000000000 +0100
+++ links-1.00pre7/links.h	2004-06-19 17:29:55.000000000 +0200
@@ -839,6 +839,7 @@ unsigned char *join_urls(unsigned char *
 unsigned char *translate_url(unsigned char *, unsigned char *);
 unsigned char *extract_position(unsigned char *);
 void get_filename_from_url(unsigned char *, unsigned char **, int *);
+void add_conv_str(unsigned char **s, int *l, unsigned char *b, int ll);
 
 /* connect.c */
 
diff -Nurp links-1.00pre6/select.c links-1.00pre7/select.c
--- links-1.00pre6/select.c	2003-11-30 00:05:42.000000000 +0100
+++ links-1.00pre7/select.c	2004-06-19 16:47:08.000000000 +0200
@@ -224,9 +224,11 @@ void got_signal(int sig)
 	check_for_select_race();
 }
 
+struct sigaction sa_zero;
+
 void install_signal_handler(int sig, void (*fn)(void *), void *data, int critical)
 {
-	struct sigaction sa = {};
+	struct sigaction sa = sa_zero;
 	if (sig >= NUM_SIGNALS || sig < 0) {
 		internal("bad signal number: %d", sig);
 		return;
@@ -302,6 +304,7 @@ int terminate = 0;
 
 void select_loop(void (*init)())
 {
+	memset(&sa_zero, 0, sizeof sa_zero);
 	memset(signal_mask, 0, sizeof signal_mask);
 	memset(signal_handlers, 0, sizeof signal_handlers);
 	FD_ZERO(&w_read);
diff -Nurp links-1.00pre6/url.c links-1.00pre7/url.c
--- links-1.00pre6/url.c	2004-06-06 03:11:35.000000000 +0200
+++ links-1.00pre7/url.c	2004-06-19 17:29:55.000000000 +0200
@@ -461,3 +461,17 @@ void get_filename_from_url(unsigned char
 	}
 	*l = url - *s;
 }
+
+#define accept_char(x)  ((unsigned char)x >= ' ' && x != '"' && x != '&' && x != '/' && x != '<' && x != '>')
+
+void add_conv_str(unsigned char **s, int *l, unsigned char *b, int ll)
+{
+	for (; ll; ll--, b++) {
+		if (accept_char(*b)) add_chr_to_str(s, l, *b);
+		else {
+			add_to_str(s, l, "&#");
+			add_num_to_str(s, l, (int)*b);
+			add_chr_to_str(s, l, ';');
+		}
+	}
+}