Urs Janßen | 13 Nov 2007 03:31

(fwd) tin fails to handle SIGWINCH

Any Mac OS X users around which like to have a look into this?

----- Forwarded message from Thomas Kaehn <8656396 <at> nurfuerspam.de> -----

Hi,

I am using Mac OS X 10.4, XCode 2.4.1.

tin fails to handle SIGWINCH when configuring and compiling
tin to use ncurses.

I tried to use the ncurses library shipped with Mac OS X
and a version found in MacPorts (I made sure that
--enable-sigwinch is set).

Mutt has no problem recognizing window changes. So I guess
the problem could be related to tin.

Ciao,
Thomas

----- End forwarded message -----

Thomas Dickey | 13 Nov 2007 11:58
Picon

Re: (fwd) tin fails to handle SIGWINCH

On Tue, 13 Nov 2007, Urs Janßen wrote:

> Any Mac OS X users around which like to have a look into this?
>
> ----- Forwarded message from Thomas Kaehn <8656396 <at> nurfuerspam.de> -----
>
> Hi,
>
> I am using Mac OS X 10.4, XCode 2.4.1.
>
> tin fails to handle SIGWINCH when configuring and compiling
> tin to use ncurses.
>
> I tried to use the ncurses library shipped with Mac OS X
> and a version found in MacPorts (I made sure that
> --enable-sigwinch is set).
>
> Mutt has no problem recognizing window changes. So I guess
> the problem could be related to tin.

The last I recalled in this area is that Mac OS X has ifdef'd SIGWINCH
to be undefined when POSIX-related definitions are turned on.  I added
a fix in xterm and ncurses last year to ensure that SIGWINCH is defined,
but "older" versions of ncurses wouldn't have the fix.

--

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Urs Janßen | 25 Nov 2007 18:31

Re: BUG REPORT tin 1.8.3 release 20070201 ("Scotasay") [UNIX]

On Sun, Nov 25, 2007 at 03:26:53AM -0600, Philip M. White wrote:
> When I view a newsgroup where I have never posted before and press 'W',

actually this happens when the posted-histiry file is empty

> tin prints the following message:
> tin: memory exhausted trying to allocate 0 bytes in file ./page.c line 2260
> ... and crashes.

a possible fix: allow realloc(x, null)

--- memory.c	2006-12-22 02:41:55.000000000 +0100
+++ memory.c	2007-11-25 18:30:48.717170884 +0100
 <at>  <at>  -530,11 +530,15  <at>  <at> 
 	debug_print_malloc(FALSE, file, line, size);
 #endif /* DEBUG */

-	p = ((!p) ? (calloc(1, size)) : realloc(p, size));
-
-	if (p == NULL) {
-		error_message(txt_out_of_memory, tin_progname, size, file, line);
-		giveup();
+	if (p && !size) {
+		free(p);
+		return NULL;
+	} else {
+		p = ((!p) ? (calloc(1, size)) : realloc(p, size));
+		if (p == NULL && size != 0) {
+			error_message(txt_out_of_memory, tin_progname, size, file, line);
+			giveup();
(Continue reading)

Urs Janßen | 27 Nov 2007 18:00

[tin 1.9.x] int -> size_t

the following should be safe (but I may have overlooked something), it
eleminates a few casts (and fixes a warning in post.c (where I used size_t
instead of int)).

-----------------------------------------------------------------------------
 include/proto.h |   10 +++++-----
 src/charset.c   |    2 +-
 src/cook.c      |    8 ++++----
 src/help.c      |    2 +-
 src/mail.c      |    2 +-
 src/misc.c      |    8 ++++----
 src/rfc2045.c   |   10 +++++-----
 src/rfc2047.c   |    2 +-
 8 files changed, 22 insertions(+), 22 deletions(-)
-----------------------------------------------------------------------------
diff -Nurp tin-1.9.3/include/proto.h tin-1.9.3.x/include/proto.h
--- tin-1.9.3/include/proto.h	2007-10-05 00:45:32.000000000 +0200
+++ tin-1.9.3.x/include/proto.h	2007-11-27 17:28:21.000000000 +0100
 <at>  <at>  -86,7 +86,7  <at>  <at>  extern void write_attributes_file(const 
 /* charset.c */
 extern char *convert_to_printable(char *buf);
 extern t_bool is_art_tex_encoded(FILE *fp);
-extern void convert_iso2asc(char *iso, char **asc_buffer, int *max_line_len, int t);
+extern void convert_iso2asc(char *iso, char **asc_buffer, size_t *max_line_len, int t);
 extern void convert_tex2iso(char *from, char *to);
 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
 	extern wchar_t *wconvert_to_printable(wchar_t *wbuf);
 <at>  <at>  -116,7 +116,7  <at>  <at>  extern void write_config_file(char *file
 /* cook.c */
 extern const char *get_filename(t_param *ptr);
(Continue reading)


Gmane