diff -ru mutt-0.87.4/init.c mutt-0.87.4w/init.c --- mutt-0.87.4/init.c Mon Oct 27 18:55:23 1997 +++ mutt-0.87.4w/init.c Wed Oct 29 16:35:27 1997 @@ -1251,6 +1251,7 @@ char *p; /* Get some information about the user */ +#ifndef __CYGWIN32__ if ((pw = getpwuid (getuid ())) == NULL) { mutt_error ("Out of memory!"); @@ -1270,6 +1271,20 @@ strfcpy (Realname, pw->pw_gecos, sizeof (Realname)); if ((p = strchr (Realname, ','))) *p = 0; strfcpy (Shell, pw->pw_shell, sizeof (Shell)); +#else + /* CYGWIN32 doesn't have getpwuid as of b18. This could probably + * be done with win32 functions, but we make some good guesses for + * right now + */ + if ((p = getenv ("USERNAME")) != NULL) + strfcpy (Username, p, sizeof (Username)); + + if ((p = getenv ("HOME")) != NULL) + strfcpy (Homedir, p, sizeof (Homedir)); + + /* Nothing to generate Realname from */ + strfcpy (Shell, EXECSHELL, sizeof (Shell)); +#endif #ifdef DEBUG /* Start up debugging mode if requested */ diff -ru mutt-0.87.4/lib.c mutt-0.87.4w/lib.c --- mutt-0.87.4/lib.c Fri Oct 24 17:44:20 1997 +++ mutt-0.87.4w/lib.c Wed Oct 29 13:38:40 1997 @@ -695,6 +695,8 @@ if ((fd = open (path, flags, 0600)) < 0) return NULL; +#ifndef __CYGWIN32__ + /* Under CYGWIN32 b18, symlinks work, but aren't real links */ /* make sure the file is not symlink */ if (lstat (path, &osb) < 0 || fstat (fd, &nsb) < 0 || osb.st_dev != nsb.st_dev || osb.st_ino != nsb.st_ino || @@ -704,6 +706,7 @@ close (fd); return (NULL); } +#endif return (fdopen (fd, mode)); } diff -ru mutt-0.87.4/mutt.h mutt-0.87.4w/mutt.h --- mutt-0.87.4/mutt.h Mon Oct 27 19:03:41 1997 +++ mutt-0.87.4w/mutt.h Wed Oct 29 16:58:34 1997 @@ -47,6 +47,17 @@ #define SETEGID setgid #endif +#ifndef _POSIX_PATH_MAX +#define _POSIX_PATH_MAX 256 +#endif + +/* the "nfs safe" dot locking method we use doesn't work under NT because + * the filesystem doesn't maintain information on how many links a file has + */ +#ifdef __CYGWIN32__ +#undef USE_DOTLOCK +#endif + #define whitespace(c) ((c) == ' ' || (c) == '\t' || (c) == '\r' || (c) == '\n') #define FOREVER while (1) Only in mutt-0.87.4w: mx.o diff -ru mutt-0.87.4/pager.c mutt-0.87.4w/pager.c --- mutt-0.87.4/pager.c Fri Oct 24 17:44:21 1997 +++ mutt-0.87.4w/pager.c Thu Oct 30 16:52:52 1997 @@ -592,7 +592,8 @@ if (n == 0 || ISHEADER (lineInfo[n-1].type)) { - if (buf[0] == '\n') + if (buf[0] == '\n' || + (buf[0] && buf[1] && buf[0] == '\r' && buf[1] == '\n')) lineInfo[n].type = MT_COLOR_NORMAL; else if (n > 0 && (buf[0] == ' ' || buf[0] == '\t')) { @@ -725,7 +726,17 @@ { fmt[0] = 0; return (-1); + } + else if (buf[0] == 0) + { + /* Under CYGWIN32 at least, fgets doesn't return NULL, but returns + * a NULL string, so handle that + */ + fmt[0] = 0; + *last_pos = ftell (f); + return (-1); } + *last_pos = ftell (f); b_read = (int) (*last_pos - offset); *buf_ready = 1; @@ -1266,7 +1277,7 @@ do_color = do_color ? M_SHOWCOLOR : M_SHOWFLAT; - if ((fp = fopen (fname, "r")) == NULL) + if ((fp = fopen (fname, "rb")) == NULL) { mutt_perror (fname); return (-1); @@ -1409,6 +1420,8 @@ if ((redraw & REDRAW_INDEX) || topline != oldtopline) { do { + int ret; + move (bodyoffset, 0); curline = oldtopline = topline; lines = 0; @@ -1416,10 +1429,13 @@ while (lines < bodylen && lineInfo[curline].offset <= sb.st_size - 1) { - if (display_line (fp, &last_pos, &lineInfo, curline, &lastLine, + ret = display_line (fp, &last_pos, &lineInfo, curline, &lastLine, &maxLine, do_color | hideQuoted | SearchFlag, - &QuoteList, &q_level, &force_redraw, &SearchRE) > 0) + &QuoteList, &q_level, &force_redraw, &SearchRE); + if (ret > 0) lines++; + else if (ret < 0) + break; curline++; } last_offset = lineInfo[curline].offset; diff -ru mutt-0.87.4/print.c mutt-0.87.4w/print.c --- mutt-0.87.4/print.c Mon Oct 27 19:03:41 1997 +++ mutt-0.87.4w/print.c Thu Oct 30 15:09:56 1997 @@ -130,7 +130,8 @@ continue; from = 1; } - else if (buf[0] == '\n') + else if ((buf[0] == '\n') + || (buf[0] && buf[1] && buf[0] == '\r' && buf[1] == '\n')) break; /* end of header */ if (flags & CH_WEED) @@ -213,7 +214,8 @@ continue; from = 1; } - else if (buf[0] == '\n') + else if ((buf[0] == '\n') + || (buf[0] && buf[1] && buf[0] == '\r' && buf[1] == '\n')) break; /* end of header */ if (flags & CH_WEED) diff -ru mutt-0.87.4/signal.c mutt-0.87.4w/signal.c --- mutt-0.87.4/signal.c Fri Oct 24 17:44:21 1997 +++ mutt-0.87.4w/signal.c Wed Oct 29 15:11:35 1997 @@ -21,6 +21,7 @@ #include #include +#include static sigset_t Sigset; static int IsEndwin = 0;