home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume7
/
elm_update
/
part1
/
Edit1
Wrap
Text File
|
1986-11-30
|
53KB
|
2,544 lines
: Use /bin/sh
# This is the automatically generated output of the AUTODIFF program after
# being run on the two directories;
#
# Old Directory: Elm-Posted
# New Directory: Elm
# Any problems with execution of this script should be reported to the
# author of the program, Dave Taylor, at "hplabs!taylor". Thanks
# first off, let's make sure we're running in SH
export PATH || (sh $0; exit $$)
# next, let's ensure the user has "ed"...
if [ ! -f /bin/ed ]
then
echo I can\'t find /bin/ed\!
exit 1
fi
# finally, let's get this show on the road!!
#-------------------------------------
# File 'doc/newmail.1' diffs...
cat << 'EOF' > doc/newmail.D
36a
If the message is a \fIpriority\fR message (that is, it has a field
in the header "Priority:"), then the line will be "PRIORITY mail"
instead of "New mail".
.P
.
w
EOF
chars=`cat doc/newmail.1 | wc -c`
if [ $chars -ne 1214 ]
then
echo Your file doc/newmail.1 has been changed\!
echo diffs saved as \"doc/newmail.D\"
else
echo applying diffs to file doc/newmail.1...
/bin/cat doc/newmail.D | /bin/ed - doc/newmail.1
fi
#-------------------------------------
# File 'doc/readmsg.1' diffs...
cat << 'EOF' > doc/readmsg.D
137a
.SH BUGS
The '*' metacharacter doesn't always work as expected!
.br
Perhaps the pattern matching should be case insensitive?
.
50c
the last message in the mailfile. Similarly, '*' is understood to
represent every message in the file (that is, 1-$)
.
w
EOF
chars=`cat doc/readmsg.1 | wc -c`
if [ $chars -ne 3454 ]
then
echo Your file doc/readmsg.1 has been changed\!
echo diffs saved as \"doc/readmsg.D\"
else
echo applying diffs to file doc/readmsg.1...
/bin/cat doc/readmsg.D | /bin/ed - doc/readmsg.1
fi
#-------------------------------------
# File 'doc/Config.guide' diffs...
cat << 'EOF' > doc/Config.gui.D
349c
-------------------------------------------------------------------------------------
.
140c
(can't be within this boundary) */
.
120c
-------------------------------------------------------------------------------------
.
84c
systems, including HP-UX (and the \fISPECTRUM\fR series!) or simulations thereof.
.
68a
It's \fIhighly\fR recommended that installation be done by using the
\fBConfigure.sh\fR script supplied with the system. Please see the
file \fIInstructions\fR for further information.
.sp 2
.P
.
w
EOF
chars=`cat doc/Config.guide | wc -c`
if [ $chars -ne 20499 ]
then
echo Your file doc/Config.guide has been changed\!
echo diffs saved as \"doc/Config.gui.D\"
else
echo applying diffs to file doc/Config.guide...
/bin/cat doc/Config.gui.D | /bin/ed - doc/Config.guide
fi
#-------------------------------------
# File 'doc/wnewmail.1' diffs...
cat << 'EOF' > doc/wnewmail.D
37a
If the message is a \fIpriority\fR message (that is, the
header contains a line "Priority:"), then the line output
will be "PRIORITY mail from ..." rather than just "Mail from".
.P
.
w
EOF
chars=`cat doc/wnewmail.1 | wc -c`
if [ $chars -ne 1318 ]
then
echo Your file doc/wnewmail.1 has been changed\!
echo diffs saved as \"doc/wnewmail.D\"
else
echo applying diffs to file doc/wnewmail.1...
/bin/cat doc/wnewmail.D | /bin/ed - doc/wnewmail.1
fi
#-------------------------------------
# File 'doc/Ref.guide' diffs...
cat << 'EOF' > doc/Ref.gui.D
290,291c
There is also a built in pager, considerably faster than calling
a remote one, called 'builtin'. This is the default if none is
specified.
.
w
EOF
chars=`cat doc/Ref.guide | wc -c`
if [ $chars -ne 39623 ]
then
echo Your file doc/Ref.guide has been changed\!
echo diffs saved as \"doc/Ref.gui.D\"
else
echo applying diffs to file doc/Ref.guide...
/bin/cat doc/Ref.gui.D | /bin/ed - doc/Ref.guide
fi
#-------------------------------------
# File 'doc/Users.guide' diffs...
cat << 'EOF' > doc/Users.gui.D
857c
namely Guy Hillyer, Bruce Townsend and special guest appearances
(almost \fIall\fR the BSD fixes for Elm 1.1) by Eric Negaard.
.
841c
John Dilley (who got the SPECTRUM version checked out, too!) and Carl Dierschow.
.
541c
.mk a
.
517c
.mk a
.
425c
.mk a
.
393c
.mk a
.
166,167c
.mk a
.mk a
.
w
EOF
chars=`cat doc/Users.guide | wc -c`
if [ $chars -ne 25463 ]
then
echo Your file doc/Users.guide has been changed\!
echo diffs saved as \"doc/Users.gui.D\"
else
echo applying diffs to file doc/Users.guide...
/bin/cat doc/Users.gui.D | /bin/ed - doc/Users.guide
fi
#-------------------------------------
# File 'doc/elm.1' diffs...
cat << 'EOF' > doc/elm.1.D
65a
.TP
.
63a
.TP
.
21c
.B \-s
.
8c
.B \-achkKmrwz
.
w
EOF
chars=`cat doc/elm.1 | wc -c`
if [ $chars -ne 2788 ]
then
echo Your file doc/elm.1 has been changed\!
echo diffs saved as \"doc/elm.1.D\"
else
echo applying diffs to file doc/elm.1...
/bin/cat doc/elm.1.D | /bin/ed - doc/elm.1
fi
#---------------------------------
# File Elm/doc/messages.1 is new!
echo File Elm/doc/messages.1 is new - extracting...
if [ -f doc/messages.1 ]
then
echo File \'doc/messages.1\' is new, but you already have something called that\!
echo I\'m going to move your file to \'doc/messages.1.old\'...
/bin/mv -f doc/messages.1 doc/messages.1.old
else
echo Extracting new file \'doc/messages.1\'
fi
cat > doc/messages.1 << 'END_OF_FILE'
.TH MESSAGES 1L
.ad b
.SH NAME
messages - quick count of messages in mailbox or folder
.SH SYNOPSIS
.B messages
.br
.B messages
folder-name
.SH HP-UX COMPATIBILITY
.TP 10
Level:
HP-UX/STANDARD
.TP
Origin:
Hewlett-Packard
.SH DESCRIPTION
.I Messages
counts the occurances of "^From\ " in either the current incoming
mailbox or the specified folder.
.P
This is, in fact, a simple little shell script!!
.SH AUTHOR
Dave Taylor, Hewlett-Packard Laboratories
.SH SEE\ ALSO
from(1L), elm(1L)
.SH BUGS
Don't be foolish...
END_OF_FILE
chars=`cat doc/messages.1 | wc -c`
if [ $chars -ne 515 ]
then
echo File damaged in transit...should be 515 bytes, is $chars instead
echo I suggest you check it closely...
fi
#---------------------------------
# File Elm/doc/trim-headers.1 is new!
echo File Elm/doc/trim-headers.1 is new - extracting...
if [ -f doc/trim-headers.1 ]
then
echo File \'doc/trim-headers.1\' is new, but you already have something called that\!
echo I\'m going to move your file to \'doc/trim-headers.1.old\'...
/bin/mv -f doc/trim-headers.1 doc/trim-headers.1.old
else
echo Extracting new file \'doc/trim-headers.1\'
fi
cat > doc/trim-headers.1 << 'END_OF_FILE'
.TH TRIM-HEADERS 1L
.ad b
.SH NAME
trim-headers - help keep mailbox files clean of trash headers
.SH SYNOPSIS
cat \fIfilename\fR |
.B trim-headers
> \fIfilename2\fR
.br
.B trim-headers
filename-list
.SH HP-UX COMPATIBILITY
.TP 10
Level:
HP-UX/STANDARD
.TP
Origin:
Hewlett-Packard Laboratories
.SH DESCRIPTION
.I Trim-headers
is a simple awk script that removes all headers from the specified
folder, either standard input or one of a list of filenames, according
to how it's invoked. The program knows about the following headers;
.sp
.nf
From
From:
Subject:
To:
Cc:
Date:
.fi
All other headers are considered extraneous and are removed.
.SH AUTHOR
Dave Taylor, Hewlett-Packard Laboratories
.SH SEE\ ALSO
awk(1), printmail(1L), readmsg(1L)
.SH BUGS
The current incancation of the \fIawk\fR script doesn't understand
the idea of multiple line header fields, so a message that has, say,
a three line To: list will only have the first line saved...
END_OF_FILE
chars=`cat doc/trim-headers.1 | wc -c`
if [ $chars -ne 955 ]
then
echo File damaged in transit...should be 955 bytes, is $chars instead
echo I suggest you check it closely...
fi
#-------------------------------------
# File 'src/alias.c' diffs...
cat << 'EOF' > src/alias.c.D
288a
if (mini_menu) show_alias_menu();
.
244c
PutLine1(LINES-1,0,"Aliased address: %-60.60s",
.
240c
PutLine1(LINES-1,0,"Group alias:%-60.60s", address);
.
225a
case LINE_FEED:
.
w
EOF
chars=`cat src/alias.c | wc -c`
if [ $chars -ne 7725 ]
then
echo Your file src/alias.c has been changed\!
echo diffs saved as \"src/alias.c.D\"
else
echo applying diffs to file src/alias.c...
/bin/cat src/alias.c.D | /bin/ed - src/alias.c
fi
#-------------------------------------
# File 'src/curses.c' diffs...
cat << 'EOF' > src/curses.c.D
422c
printf(_clearbold);
.
409c
printf("%s", _setbold); /* don't ask, okay? */
.
174c
if (strlen(termcap_label) < 2)
return(NULL);
if (termcap_label[0] == 's' && termcap_label[1] == 'o')
sprintf(escape_sequence, _setinverse);
else if (termcap_label[0] == 's' && termcap_label[1] == 'e')
sprintf(escape_sequence, _clearinverse);
else if ((myptr = tgetstr(termcap_label, &ptr)) == NULL)
return( (char *) NULL );
else
sprintf(escape_sequence, myptr);
.
170c
char *myptr, *tgetstr(); /* Get termcap capability */
.
152,155d
114a
#ifdef BSD
initscr(); /* initalize curses too! */
#endif
.
44a
#ifdef SHORTNAMES
# define CleartoEOS ClrtoEOS
# define _clearinverse _clrinv
# define _cleartoeoln _clrtoeoln
# define _cleartoeos _clr2eos
# define _transmit_off xmit_off
# define _transmit_on xmit_on
#endif
.
28c
# ifndef BSD4.1
# include <sgtty.h>
# endif
.
w
EOF
chars=`cat src/curses.c | wc -c`
if [ $chars -ne 15951 ]
then
echo Your file src/curses.c has been changed\!
echo diffs saved as \"src/curses.c.D\"
else
echo applying diffs to file src/curses.c...
/bin/cat src/curses.c.D | /bin/ed - src/curses.c
fi
#-------------------------------------
# File 'src/date.c' diffs...
cat << 'EOF' > src/date.c.D
372a
#ifdef SITE_HIDING
char *get_ctime_date()
{
/** returns a ctime() format date, but a few minutes in the
past...(more cunningness to implement hidden sites) **/
static char buffer[SLEN]; /* static character buffer */
struct tm *the_time, /* Time structure, see CTIME(3C) */
*localtime();
long junk; /* time in seconds.... */
#ifdef BSD
struct timeval time_val;
struct timezone time_zone;
#endif
#ifdef BSD
gettimeofday(&time_val, &time_zone);
junk = time_val.tv_sec;
#else
junk = (long) time((long *) 0); /* this must be here for it to work! */
#endif
the_time = localtime(&junk);
sprintf(buffer, "%s %s %d %02d:%02d:%02d %d",
arpa_dayname[the_time->tm_wday],
arpa_monname[the_time->tm_mon],
the_time->tm_mday % 32,
min(the_time->tm_hour % 24, (rand() % 24)),
min(abs(the_time->tm_min % 61 - (rand() % 60)), (rand() % 60)),
min(abs(the_time->tm_sec % 61 - (rand() % 60)), (rand() % 60)),
the_time->tm_year % 100 + 1900);
return( (char *) buffer);
}
#endif
.
339c
return( minute1 - minute2 ); /* ignore seconds... */
.
335a
/* did we get the time? If not, try again */
if (minute1 < 0)
sscanf(rec1->time, "%2d%2d", &hour1, &minute1);
if (minute2 < 0)
sscanf(rec2->time, "%2d%2d", &hour2, &minute2);
/** deal with am/pm, if present... **/
if (strlen(rec1->time) > 3)
if (rec1->time[strlen(rec1->time)-2] == 'p')
hour1 += 12;
if (strlen(rec2->time) > 3)
if (rec2->time[strlen(rec2->time)-2] == 'p')
hour2 += 12;
.
332a
minute1 = minute2 = -1;
.
282c
sprintf(timestring, "12:%2.2d (midnight)", minute);
.
192c
junk = (long) time((long *) 0); /* this must be here for it to work! */
.
146a
# endif
.
145a
# ifdef BSD4.1
timezone(time_zone.timezone, the_time->tm_isdst));
# else
.
134a
.
133c
junk = (long) time((long *) 0); /* this must be here for it to work! */
.
131a
# endif
.
129d
127d
124a
# ifdef BSD4.1
struct timeb loc_time;
junk = (long) time(long *) 0);
ftime(&loc_time);
# else
.
123a
.
68c
junk = (long) time((long *) 0); /* this must be here for it to work! */
.
18a
#undef tolower
.
10c
# ifndef BSD4.1
# include <sys/time.h>
# else
# include <time.h>
# include <sys/types.h>
# include <sys/timeb.h>
# endif
.
8a
.
w
EOF
chars=`cat src/date.c | wc -c`
if [ $chars -ne 9538 ]
then
echo Your file src/date.c has been changed\!
echo diffs saved as \"src/date.c.D\"
else
echo applying diffs to file src/date.c...
/bin/cat src/date.c.D | /bin/ed - src/date.c
fi
#-------------------------------------
# File 'src/delete.c' diffs...
cat << 'EOF' > src/delete.c.D
80c
if (msg == current && !arrow_cursor) {
StartBold();
PutLine2((msg % headers_per_page) + 4, 3, "%c%c",
ison(header_table[msg].status, DELETED)? 'D' : ' ',
ison(header_table[msg].status, TAGGED )? '+' : ' ');
EndBold();
}
else
PutLine2((msg % headers_per_page) + 4, 3, "%c%c",
.
67c
if (msg == current && !arrow_cursor) {
StartBold();
Writechar( ison(header_table[msg].status, TAGGED)? '+' : ' ');
EndBold();
}
else
Writechar( ison(header_table[msg].status, TAGGED)? '+' : ' ');
.
44c
if (msg == current && !arrow_cursor) {
StartBold();
Writechar( ison(header_table[msg].status, DELETED)? 'D' : ' ');
EndBold();
}
else
Writechar( ison(header_table[msg].status, DELETED)? 'D' : ' ');
.
w
EOF
chars=`cat src/delete.c | wc -c`
if [ $chars -ne 1863 ]
then
echo Your file src/delete.c has been changed\!
echo diffs saved as \"src/delete.c.D\"
else
echo applying diffs to file src/delete.c...
/bin/cat src/delete.c.D | /bin/ed - src/delete.c
fi
#-------------------------------------
# File 'src/aliasdb.c' diffs...
cat << 'EOF' > src/aliasdb.D
169c
} while (absolute(last) - absolute(first) > FIND_DELTA);
.
135a
strcat(expanded, comment); /* add comment */
.
132a
}
.
131c
else { /* We just can't get there! */
strcpy(expanded, old_name); /* restore! */
.
124a
strcat(expanded, comment); /* patch in comment */
.
104a
dprint3(5,"\nBroke address into '%s' @ '%s' '%s'\n\n",
name, sitename, comment);
.
94c
while (cryptic[i] != '\0' && cryptic[i] != '(' &&
! whitespace(cryptic[i]))
.
81c
cryptic[i] != '\0' && cryptic[i] != '(')
.
79a
/** first, rip out the comment, if any **/
if ((i = chloc(cryptic, '(')) > -1) {
comment[j++] = ' '; /* leading space */
for ( ;cryptic[i] != ')'; i++)
comment[j++] = cryptic[i];
comment[j++] = ')';
comment[j] = '\0';
/* and remove this from cryptic string too... */
if (cryptic[(j = chloc(cryptic,'('))-1] == ' ')
cryptic[j-1] = '\0';
else
cryptic[j] = '\0';
}
else
comment[0] = '\0';
i = j = 0; /* reset */
.
72c
temp[VERY_LONG_STRING], old_name[VERY_LONG_STRING],
comment[LONG_STRING];
.
62c
0 = found, -1 return means unknown site code
Modified to strip out parenthetical comments...
**/
.
40,41c
if (mail_only)
printf("Warning: couldn't expand %s...\n\r", name);
else {
error1("Warning: couldn't expand %s...", name);
sleep(1);
}
.
13a
#define absolute(x) ((x) > 0 ? x : -(x))
.
w
EOF
chars=`cat src/aliasdb.c | wc -c`
if [ $chars -ne 5484 ]
then
echo Your file src/aliasdb.c has been changed\!
echo diffs saved as \"src/aliasdb.D\"
else
echo applying diffs to file src/aliasdb.c...
/bin/cat src/aliasdb.D | /bin/ed - src/aliasdb.c
fi
#-------------------------------------
# File 'src/file.c' diffs...
cat << 'EOF' > src/file.c.D
158c
ptr = filename;
while (*ptr == ' ') ptr++; /* leading spaces GONE! */
strcpy(filename, ptr);
/** New stuff - make sure no illegal char as last **/
.
155c
char buffer[SLEN], varname[SLEN], env_value[SLEN], *ptr;
.
79a
#endif
.
78a
#ifdef BSD4.1
if ((errno = ((can_open(filename, "a") & ~0x0200) >>8))) {
#else
.
w
EOF
chars=`cat src/file.c | wc -c`
if [ $chars -ne 5704 ]
then
echo Your file src/file.c has been changed\!
echo diffs saved as \"src/file.c.D\"
else
echo applying diffs to file src/file.c...
/bin/cat src/file.c.D | /bin/ed - src/file.c
fi
#-------------------------------------
# File 'src/read_rc.c' diffs...
cat << 'EOF' > src/read_rc.D
367c
pmalloc(strlen(default_list[weedcount]) + 1)) == NULL) {
.
342c
pmalloc(sizeof *alternative_addresses);
.
334c
pmalloc(sizeof *alternative_addresses);
.
305c
if ((weedlist[weedcount] = pmalloc(strlen(header) + 1)) == NULL) {
.
63c
char *shift_lower(), *strtok(), *getenv(), *pmalloc();
.
w
EOF
chars=`cat src/read_rc.c | wc -c`
if [ $chars -ne 12722 ]
then
echo Your file src/read_rc.c has been changed\!
echo diffs saved as \"src/read_rc.D\"
else
echo applying diffs to file src/read_rc.c...
/bin/cat src/read_rc.D | /bin/ed - src/read_rc.c
fi
#-------------------------------------
# File 'src/hdrconfg.c' diffs...
cat << 'EOF' > src/hdrconfg.D
95c
case 'I' : if (strlen(in_reply_to) > 0) {
.
84c
case 'R' : if (optionally_enter(reply_to, 7, 10, FALSE) == -1)
.
67c
case RETURN:
case LINE_FEED:
.
w
EOF
chars=`cat src/hdrconfg.c | wc -c`
if [ $chars -ne 4054 ]
then
echo Your file src/hdrconfg.c has been changed\!
echo diffs saved as \"src/hdrconfg.D\"
else
echo applying diffs to file src/hdrconfg.c...
/bin/cat src/hdrconfg.D | /bin/ed - src/hdrconfg.c
fi
#-------------------------------------
# File 'src/help.c' diffs...
cat << 'EOF' > src/help.c.D
9a
#ifdef BSD
# undef tolower
#endif
.
w
EOF
chars=`cat src/help.c | wc -c`
if [ $chars -ne 5576 ]
then
echo Your file src/help.c has been changed\!
echo diffs saved as \"src/help.c.D\"
else
echo applying diffs to file src/help.c...
/bin/cat src/help.c.D | /bin/ed - src/help.c
fi
#-------------------------------------
# File 'src/initialize.c' diffs...
cat << 'EOF' > src/initialize.D
199a
/** allocate the first KLICK headers... **/
if ((header_table = (struct header_rec *) malloc(KLICK * sizeof (struct
header_rec))) == NULL) {
fprintf(stderr,"\n\r\n\rCouldn't allocate initial headers!\n\r\n");
leave();
}
max_headers = KLICK; /* we have those preallocated */
/** now cruise along... **/
.
181a
dprint0(1,"past the return_ stuff\n");
.
174a
else if (strlen(cp) != 2)
cursor_control = FALSE;
.
173c
if ((cp = return_value_of("kd")) == NULL)
.
169,171c
cursor_control = FALSE;
if ((cp = return_value_of("ku")) != NULL)
if (strlen(cp) != 2) {
dprint0(1,"ku != NULL\n");
.
148a
ScreenSize(&LINES, &COLUMNS);
.
113,114c
full_username[j++] = pass->pw_gecos[i];
full_username[j] = '\0';
.
110c
j = strlen(full_username);
.
108c
full_username[j] = '\0';
.
105c
/* fix for this section from Don Joslyn of Nova University */
for (i=0,j=0; pass->pw_gecos[i] != '\0' && pass->pw_gecos[i] != ',';
.
74a
#endif
.
72a
#ifndef BSD /* if BSD we've already done this! */
.
46c
register int i, j;
.
34c
char *error_name(), *error_description(), *malloc();
.
31d
27a
#undef toupper
.
w
EOF
chars=`cat src/initialize.c | wc -c`
if [ $chars -ne 7108 ]
then
echo Your file src/initialize.c has been changed\!
echo diffs saved as \"src/initialize.D\"
else
echo applying diffs to file src/initialize.c...
/bin/cat src/initialize.D | /bin/ed - src/initialize.c
fi
#-------------------------------------
# File 'src/showmsg.c' diffs...
cat << 'EOF' > src/showmsg.D
275,276c
if (errno != 0)
dprint1(1,"\terror %s hit!\n", error_name(errno));
}
}
int
secure_display(lines, msgnumber)
int lines, msgnumber;
{
/** This is the cheap way to implement secure pipes - spawn a
child process running under the old userid, then open the
pager and feed the message to it. When the subprocess ends
(the routine returns) simply return. Simple and effective.
(too bad it's this much of a hassle to implement secure
pipes, though - I can imagine it being a constant problem!)
**/
int stat = 0, pid, w;
#ifdef BSD
union wait status;
#else
int status;
#endif
register int (*istat)(), (*qstat)();
#ifdef NO_VM /* machine without virtual memory! */
if ((pid = fork()) == 0) {
#else
if ((pid = vfork()) == 0) {
#endif
setgid(groupid); /* and group id */
setuid(userid); /* back to the normal user! */
_exit(display(lines, msgnumber));
}
istat = signal(SIGINT, SIG_IGN);
qstat = signal(SIGQUIT, SIG_IGN);
while ((w = wait(&status)) != pid && w != -1)
;
signal(SIGINT, istat);
signal(SIGQUIT, qstat);
#ifdef BSD
return(status.w_retcode);
#else
return(status);
#endif
.
272,273c
if (builtin) {
strcat(buffer, "\n\r");
pipe_abort = display_line(buffer);
}
else {
errno = 0;
fprintf(output_pipe, "%s\n", buffer);
.
270c
/** Hands the given line to the output pipe. 'builtin' is true if
we're using the builtin pager. **/
.
268a
int builtin;
.
267c
show_line(buffer, builtin)
.
259c
if (! builtin)
PutLine0(LINES+1,0,"\rPress <return> to return to Elm: ");
else
Write_to_screen("\n\r\n\rPress <return> to return to Elm: ");
.
257c
if (! builtin) pclose(output_pipe);
.
251c
show_line(buffer, builtin);
.
248c
show_line(buffer, builtin);
.
243c
show_line(buffer, builtin);
.
238c
show_line(buffer, builtin);
.
235c
show_line(buffer, builtin);
.
221c
show_line(buffer, builtin);
.
194c
if (!builtin)
PutLine0(LINES+1,0,"\rPress <return> to return to Elm: ");
else
Write_to_screen("\n\r\n\rPress <return> to return to Elm: ");
.
192c
if (!builtin)
pclose(output_pipe);
.
188c
if (!builtin) pclose(output_pipe); /* close pipe NOW! */
show_mailfile_stats();
.
173,176d
154a
if (builtin)
display_line(buffer);
else
fprintf(output_pipe, "%s", buffer);
}
.
152,153c
strlen(header_table[current-1].to) > 0) {
sprintf(buffer, "\n\r(message addressed to %s)\n\r",
.
149a
if (builtin)
display_line(buffer);
else
fprintf(output_pipe, "%s", buffer);
.
140,148c
mail_sent? "to" : "from", from_buffer,
(strlen(from_buffer) > 24? "\n\r":
(strlen(from_buffer) > 16 ? "" : "\t")),
notesfile? "Posted" : "Mailed",
full_month(header_table[msgnum-1].month),
header_table[msgnum-1].day,
atoi(header_table[msgnum-1].year) + 1900,
header_table[msgnum-1].time,
filter? "": "\n\r\n\r");
.
137,138c
tail_of(header_table[msgnum-1].from, from_buffer, FALSE);
sprintf(buffer, "\r%s #%d %s %s%s\t %s %s %s, %d at %s%s\n\r",
.
131d
124,129c
builtin = (strcmp(pager, "builtin") == 0 ||
strcmp(pager,"internal") == 0);
if (builtin)
start_builtin(lines);
else {
if ((output_pipe = popen(pager,"w")) == NULL) {
error2("Can't create pipe to %s [%s]", pager,
error_name(errno));
dprint2(1,"\n*** Can't create pipe to %s - error %s ***\n\n",
pager, error_name(errno));
return(0);
}
dprint1(4,"Opened a write-only pipe to routine %s \n", pager);
.
121a
ClearScreen();
if (cursor_control) transmit_functions(OFF);
.
117c
int mail_sent, /* misc use */
builtin = FALSE; /* our pager? */
.
111c
char from_buffer[LONG_STRING], buffer[VERY_LONG_STRING], *full_month();
.
99c
FILE *output_pipe, *popen();
.
88c
if (strcmp(pager,"builtin") == 0 || strcmp(pager,"internal") == 0)
display(lines, msgnumber);
else
secure_display(lines, msgnumber);
.
84a
if (feof(mailfile))
dprint0(1,"\n*** seek put us at END OF FILE!!! ***\n");
.
17c
# include <sys/wait.h>
# undef tolower
.
14a
#include <signal.h>
.
11d
8a
Modified 7/86 to have secure pipes.. *sigh*
.
w
EOF
chars=`cat src/showmsg.c | wc -c`
if [ $chars -ne 7704 ]
then
echo Your file src/showmsg.c has been changed\!
echo diffs saved as \"src/showmsg.D\"
else
echo applying diffs to file src/showmsg.c...
/bin/cat src/showmsg.D | /bin/ed - src/showmsg.c
fi
#-------------------------------------
# File 'src/newmbox.c' diffs...
cat << 'EOF' > src/newmbox.D
352,353c
header_table[count > 0? count-1:count].lines = line + 1;
.
266a
/** try to allocate new headers, if needed... **/
if (count >= max_headers) {
max_headers += KLICK;
dprint2(1,
"\n\nAbout to allocate headers, count = %d, max_headers=%d\n",
count, max_headers);
if ((temp_struct = (struct header_rec *) realloc(header_table,
max_headers * sizeof(struct header_rec))) == NULL) {
error1(
"\n\r\n\rCouldn't allocate enough memory! Failed on message #%d\n\r\n\r",
count);
leave();
}
header_table = temp_struct;
dprint1(1,"\tallocated %d more headers!\n\n", KLICK);
}
else
dprint1(1,"\ndidn't need to allocate headers: count=%d\n\n",
count);
.
241c
line = 0;
.
239c
line = header_table[message_count - 1].lines;
.
185a
if (access(temp_filename, ACCESS_EXISTS) != -1) {
/* Hey! What the hell is this? The temp file already exists? */
/* Looks like a potential clash of processes on the same file! */
unlock(); /* so remove lock file! */
error("What's this? The temp mailbox already exists??");
sleep(2);
error("Ahhhh.....I give up");
silently_exit(); /* leave without tampering with it! */
}
.
151a
struct header_rec *temp_struct;
.
120c
if (mailfile != NULL)
(void) fclose(mailfile); /* close it first, to avoid too many open */
.
114a
if (switching_from_default) { /* we need to remove the tmp file */
sprintf(buff, "%s%s", temp_mbox, username);
if (unlink(buff) != 0) {
error1(
"Sorry, but I can't seem to unlink your temp mail file [%s]\n\r",
error_name(errno));
silently_exit();
}
}
.
108c
PutLine1(LINES-3,COLUMNS-40,"Mailbox: %s", buff);
.
106c
PutLine0(LINES-3,COLUMNS-40,"Resynchronizing file");
.
104a
if (first_word(buff, mailhome)) { /* a mail file! */
mbox_specified = 0; /* fake program to think that */
stat = 1; /* we're the default file */
switching_to_default++; /* remember this act! */
}
.
89,93d
50a
if (stat == 1 && strlen(infile) == 0) {
/* Subtlety - check to see if there's another instantiation
of Elm (e.g. if the /tmp file is in use). If so, DIE! */
sprintf(infile, "%s%s", temp_mbox, username);
if (access(infile, ACCESS_EXISTS) != -1) {
error(
"Hey! An instantiation of Elm is already reading this mail!\n\r");
exit(1);
}
sprintf(infile, "%s%s", mailhome, username);
}
.
49a
if (mbox_specified == 0 && stat == 0)
switching_from_default++;
.
47c
int switching_to_default = 0, switching_from_default = 0;
.
25c
char *error_name(), *error_description(), *realloc();
.
18c
# ifndef BSD4.1
# include <sys/time.h>
# else
# include <time.h>
# endif
.
w
EOF
chars=`cat src/newmbox.c | wc -c`
if [ $chars -ne 11389 ]
then
echo Your file src/newmbox.c has been changed\!
echo diffs saved as \"src/newmbox.D\"
else
echo applying diffs to file src/newmbox.c...
/bin/cat src/newmbox.D | /bin/ed - src/newmbox.c
fi
#-------------------------------------
# File 'src/file_utils.c' diffs...
cat << 'EOF' > src/file_utils.D
124c
return(stat);
.
119c
#ifdef BSD
stat = status.w_retcode;
#else
stat = status;
#endif
.
108,109c
if ((fd = fopen(file, mode)) == NULL)
_exit(errno);
else {
fclose(fd); /* don't just LEAVE it! */
_exit(0);
}
.
106a
setuid(userid); /** back to normal userid **/
.
105d
97c
FILE *fd;
int stat = 0, pid, w;
#ifdef BSD
union wait status;
#else
int status;
#endif
.
93c
/** returns 0 iff user can open the file. This is not
.
85c
return(stat);
.
80,81c
#ifdef BSD
stat = status.w_retcode;
#else
stat = status;
#endif
.
69,70c
if (access(file, mode) == 0)
_exit(0);
else
_exit(errno != 0? errno : 1); /* never return zero! */
.
67a
setuid(userid); /** back to normal userid **/
.
66d
58c
int stat = 0, pid, w;
#ifdef BSD
union wait status;
#else
int status;
#endif
.
56c
/** returns ZERO iff user can access file or "errno" otherwise **/
.
19a
#ifdef BSD
# include <sys/wait.h>
#endif
.
16a
.
15c
# undef tolower
.
w
EOF
chars=`cat src/file_utils.c | wc -c`
if [ $chars -ne 4640 ]
then
echo Your file src/file_utils.c has been changed\!
echo diffs saved as \"src/file_utils.D\"
else
echo applying diffs to file src/file_utils.c...
/bin/cat src/file_utils.D | /bin/ed - src/file_utils.c
fi
#-------------------------------------
# File 'src/reply.c' diffs...
cat << 'EOF' > src/reply.c.D
362a
}
int
break_down_tolist(buf, index, address, comment)
char *buf, *address, *comment;
int *index;
{
/** This routine steps through "buf" and extracts a single address
entry. This entry can be of any of the following forms;
address (name)
name <address>
address
Once it's extracted a single entry, it will then return it as
two tokens, with 'name' (e.g. comment) surrounded by parens.
Returns ZERO if done with the string...
**/
char buffer[LONG_STRING];
register int i, loc = 0;
if (*index > strlen(buf)) return(FALSE);
while (whitespace(buf[*index])) (*index)++;
if (*index > strlen(buf)) return(FALSE);
/** Now we're pointing at the first character of the token! **/
while (buf[*index] != ',' && buf[*index] != '\0')
buffer[loc++] = buf[(*index)++];
(*index)++;
while (whitespace(buffer[loc])) loc--; /* remove trailing whitespace */
buffer[loc] = '\0';
if (strlen(buffer) == 0) return(FALSE);
dprint1(5, "\n* got \"%s\"\n", buffer);
if (buffer[loc-1] == ')') { /* address (name) format */
for (loc = 0;buffer[loc] != '(' && loc < strlen(buffer); loc++)
/* get to the opening comment character... */ ;
loc--; /* back up to just before the paren */
while (whitespace(buffer[loc])) loc--; /* back up */
/** get the address field... **/
for (i=0; i <= loc; i++)
address[i] = buffer[i];
address[i] = '\0';
/** now get the comment field, en toto! **/
loc = 0;
for (i = chloc(buffer, '('); i < strlen(buffer); i++)
comment[loc++] = buffer[i];
comment[loc] = '\0';
}
else if (buffer[loc-1] == '>') { /* name <address> format */
dprint0(7, "\tcomment <address>\n");
for (loc = 0;buffer[loc] != '<' && loc < strlen(buffer); loc++)
/* get to the opening comment character... */ ;
while (whitespace(buffer[loc])) loc--; /* back up */
/** get the comment field... **/
comment[0] = '(';
for (i=1; i < loc; i++)
comment[i] = buffer[i-1];
comment[i++] = ')';
comment[i] = '\0';
/** now get the address field, en toto! **/
loc = 0;
for (i = chloc(buffer,'<') + 1; i < strlen(buffer) - 1; i++)
address[loc++] = buffer[i];
address[loc] = '\0';
}
else {
strcpy(address, buffer);
comment[0] = '\0';
}
dprint2(5,"-- returning '%s' '%s'\n", address, comment);
return(TRUE);
.
178a
if (in_message) dprint1(1,"> %s", buf);
.
175d
170c
while (break_down_tolist(buf, &index, address, comment)) {
.
168c
/** we have a buffer with a list of addresses, each of either the
form "address (name)" or "name <address>". Our mission, should
we decide not to be too lazy, is to break it into the two parts.
**/
if (!whitespace(buf[0]))
index = chloc(buf, ':')+1; /* skip header field */
else
index = 0; /* skip whitespace */
.
135,137c
char ret_address[LONG_SLEN], buf[LONG_SLEN], new_address[LONG_SLEN],
address[LONG_SLEN], comment[LONG_SLEN];
char *bufptr;
int in_message = 1, first_pass = 0, index;
.
w
EOF
chars=`cat src/reply.c | wc -c`
if [ $chars -ne 10560 ]
then
echo Your file src/reply.c has been changed\!
echo diffs saved as \"src/reply.c.D\"
else
echo applying diffs to file src/reply.c...
/bin/cat src/reply.c.D | /bin/ed - src/reply.c
fi
#-------------------------------------
# File 'src/screen.c' diffs...
cat << 'EOF' > src/screen.c.D
245c
(highlight && has_highlighting && !arrow_cursor) ?
end_highlight : "");
.
230,231c
highlight? ((has_highlighting && !arrow_cursor) ?
start_highlight : "->") : " ",
(highlight && has_highlighting && !arrow_cursor)? " " : "",
.
w
EOF
chars=`cat src/screen.c | wc -c`
if [ $chars -ne 7956 ]
then
echo Your file src/screen.c has been changed\!
echo diffs saved as \"src/screen.c.D\"
else
echo applying diffs to file src/screen.c...
/bin/cat src/screen.c.D | /bin/ed - src/screen.c
fi
#-------------------------------------
# File 'src/strings.c' diffs...
cat << 'EOF' > src/strings.D
167c
current_length += strlen(word);
.
165c
current_length += 2;
}
for (i=(word[0] == ' '? 1:0); i<strlen(word); i++)
.
162,163c
else { /* just add this address to the list.. */
if (index > 0) {
ret_buffer[index++] = ','; /* comma added! */
.
158c
/* now add this pup! */
for (i=(word[0] == ' '? 1:0); i<strlen(word); i++)
.
152a
ret_buffer[index++] = ','; /* close 'er up, doctor! */
.
150c
while ((word = get_token(bufptr,",", depth)) != NULL) {
/* first, decide what sort of separator we need, if any... */
.
131,136c
/** Return buffer with \n\t sequences added at each point where it
would be more than 80 chars long. It only allows the breaks at
legal points (ie commas followed by white spaces). init-len is
the characters already on the first line... Changed so that if
this is called while mailing without the overhead of "elm", it'll
include "\r\n\t" instead.
Changed to use ',' as a separator and to REPLACE it after it's
found in the output stream...
.
w
EOF
chars=`cat src/strings.c | wc -c`
if [ $chars -ne 10842 ]
then
echo Your file src/strings.c has been changed\!
echo diffs saved as \"src/strings.D\"
else
echo applying diffs to file src/strings.c...
/bin/cat src/strings.D | /bin/ed - src/strings.c
fi
#-------------------------------------
# File 'src/utils.c' diffs...
cat << 'EOF' > src/utils.c.D
68a
(void) unlink(buffer);
if (! mail_only) {
MoveCursor(LINES,0);
Writechar('\n');
}
exit(0);
}
silently_exit()
{
/** This is the same as 'leave', but it doesn't remove any non-pid
files. It's used when we notice that we're trying to create a
temp mail file and one already exists!!
**/
char buffer[SLEN];
dprint0(2,"\nLeaving mailer quietly (silently_exit)\n");
Raw(OFF);
if (cursor_control) transmit_functions(OFF);
if (hp_terminal) softkeys_off();
sprintf(buffer,"%s%d",temp_file, getpid()); /* editor buffer */
(void) unlink(buffer);
sprintf(buffer,"%s%d",temp_file, getpid()+1); /* editor buffer */
.
18a
extern int errno;
char *error_name();
show_mailfile_stats()
{
/** when we're about to die, let's try to dump lots of good stuff
to the debug file... **/
struct stat buffer;
if (debug == 0) return; /* Damn! Can't do it! */
if (fstat(fileno(mailfile), &buffer) == 0) {
dprint1(1,"\nDump of stats for mailfile %s;\n", infile);
dprint3(1, "\tinode: %d, mode: %o, uid: %d, ",
buffer.st_ino, buffer.st_mode, buffer.st_uid);
dprint2(1,"gid: %d, size: %d\n\n", buffer.st_gid, buffer.st_size);
dprint1(1,"\toffset into file = %l\n", ftell(mailfile));
}
else
dprint2(1,"\nfstat on mailfile '%s' failed with error %s!!\n\n",
infile, error_name(errno));
}
.
11a
#include <errno.h>
.
w
EOF
chars=`cat src/utils.c | wc -c`
if [ $chars -ne 3786 ]
then
echo Your file src/utils.c has been changed\!
echo diffs saved as \"src/utils.c.D\"
else
echo applying diffs to file src/utils.c...
/bin/cat src/utils.c.D | /bin/ed - src/utils.c
fi
#-------------------------------------
# File 'src/syscall.c' diffs...
cat << 'EOF' > src/syscall.D
91c
return(stat);
.
86c
#ifdef BSD
if (status.w_retcode != 0) stat = status.w_retcode;
#else
if (w == -1) stat = status;
#endif
.
76c
execl("/bin/sh", "sh", "-c", string, (char *) 0);
.
73c
execl(shell, argv_zero(shell), "-c", string, (char *) 0);
.
70a
setuid(userid); /* back to the normal user! */
.
69d
58c
int stat = 0, pid, w;
#ifdef BSD
union wait status;
#else
int status;
#endif
.
12a
#ifdef BSD
# include <sys/wait.h>
#endif
.
w
EOF
chars=`cat src/syscall.c | wc -c`
if [ $chars -ne 4692 ]
then
echo Your file src/syscall.c has been changed\!
echo diffs saved as \"src/syscall.D\"
else
echo applying diffs to file src/syscall.c...
/bin/cat src/syscall.D | /bin/ed - src/syscall.c
fi
#-------------------------------------
# File 'src/aliaslib.c' diffs...
cat << 'EOF' > src/aliaslib.D
159c
/* Read from file fd. End read upon reading either
.
w
EOF
chars=`cat src/aliaslib.c | wc -c`
if [ $chars -ne 4476 ]
then
echo Your file src/aliaslib.c has been changed\!
echo diffs saved as \"src/aliaslib.D\"
else
echo applying diffs to file src/aliaslib.c...
/bin/cat src/aliaslib.D | /bin/ed - src/aliaslib.c
fi
#-------------------------------------
# File 'src/domains.c' diffs...
cat << 'EOF' > src/domains.D
16a
#ifdef BSD
# undef toupper
# undef tolower
#endif
.
w
EOF
chars=`cat src/domains.c | wc -c`
if [ $chars -ne 7635 ]
then
echo Your file src/domains.c has been changed\!
echo diffs saved as \"src/domains.D\"
else
echo applying diffs to file src/domains.c...
/bin/cat src/domains.D | /bin/ed - src/domains.c
fi
#-------------------------------------
# File 'src/fileio.c' diffs...
cat << 'EOF' > src/fileio.c.D
64a
#ifdef SITE_HIDING
int
is_a_hidden_user(username)
char *username;
{
/** Returns true iff the username is present in the list of
'hidden users' on the system.
**/
FILE *hidden_users;
char buffer[SLEN];
if ((hidden_users = fopen (HIDDEN_SITE_USERS,"r")) == NULL) {
dprint2(1,"Couldn't open hidden site file %s [%s]\n",
HIDDEN_SITE_USERS, error_name(errno));
return(FALSE);
}
while (fscanf(hidden_users, "%s", buffer) != EOF)
if (strcmp(buffer, username) == 0) {
dprint1(3,"** Found user '%s' in hidden site file!\n",
username);
fclose(hidden_users);
return(TRUE);
}
fclose(hidden_users);
dprint1(3,"** Couldn't find user '%s' in hidden site file!\n",
username);
return(FALSE);
}
#endif
.
59a
ok = 0; /* STOP NOW! */
.
14a
extern int errno;
char *error_name();
.
9a
#include <errno.h>
.
w
EOF
chars=`cat src/fileio.c | wc -c`
if [ $chars -ne 1967 ]
then
echo Your file src/fileio.c has been changed\!
echo diffs saved as \"src/fileio.c.D\"
else
echo applying diffs to file src/fileio.c...
/bin/cat src/fileio.c.D | /bin/ed - src/fileio.c
fi
#-------------------------------------
# File 'src/return_addr.c' diffs...
cat << 'EOF' > src/return_addr.D
282a
else {
/* if we have a space character, or we DON'T have '!' or '@' chars */
if (chloc(header_table[current-1].from, ' ') >= 0 ||
(chloc(header_table[current-1].from, '!') < 0 &&
chloc(header_table[current-1].from, '@') < 0))
sprintf(name2, " (%s)", header_table[current-1].from);
strcat(buffer, name2);
}
.
229a
/* now initialize all the char buffers [thanks Keith!] */
buf[0] = name1[0] = name2[0] = lastname[0] = '\0';
hold_return[0] = alt_name2[0] = '\0';
.
w
EOF
chars=`cat src/return_addr.c | wc -c`
if [ $chars -ne 9321 ]
then
echo Your file src/return_addr.c has been changed\!
echo diffs saved as \"src/return_addr.D\"
else
echo applying diffs to file src/return_addr.c...
/bin/cat src/return_addr.D | /bin/ed - src/return_addr.c
fi
#-------------------------------------
# File 'src/addr_utils.c' diffs...
cat << 'EOF' > src/addr_utils.D
219c
if (mail_only)
printf(buffer);
else
.
w
EOF
chars=`cat src/addr_utils.c | wc -c`
if [ $chars -ne 15408 ]
then
echo Your file src/addr_utils.c has been changed\!
echo diffs saved as \"src/addr_utils.D\"
else
echo applying diffs to file src/addr_utils.c...
/bin/cat src/addr_utils.D | /bin/ed - src/addr_utils.c
fi
#-------------------------------------
# File 'src/input_utils.c' diffs...
cat << 'EOF' > src/input_utils.D
85c
if (! append_current && ! mail_only)
.
83c
if (!mail_only)
PutLine1(x,y, "%s", string);
else
printf("%s", string);
.
w
EOF
chars=`cat src/input_utils.c | wc -c`
if [ $chars -ne 7235 ]
then
echo Your file src/input_utils.c has been changed\!
echo diffs saved as \"src/input_utils.D\"
else
echo applying diffs to file src/input_utils.c...
/bin/cat src/input_utils.D | /bin/ed - src/input_utils.c
fi
#-------------------------------------
# File 'src/mailtime.c' diffs...
cat << 'EOF' > src/mailtime.D
117a
/** That's what I like about programming for BSD & USG - the easy
portability between 'em. Especially the section 2 calls!! **/
.
116c
if (utime(filename, NULL) == -1) /* note no "S" */
.
114c
if (utimes(filename, &tval) == -1) /* note the "S" */
# endif
.
110a
# ifdef BSD4.1
tval = (time_t) time((long *) 0);
if (utime(filename, &tval) == -1)
# else
.
105a
# endif
.
103a
# ifdef BSD4.1
struct timeb loc_time;
time_t tval;
# else
.
73a
#ifdef BSD
extern struct tm *localtime();
#endif
.
14c
# ifndef BSD4.1
# include <sys/time.h>
# else
# include <time.h>
# include <sys/timeb.h>
# endif
.
w
EOF
chars=`cat src/mailtime.c | wc -c`
if [ $chars -ne 4271 ]
then
echo Your file src/mailtime.c has been changed\!
echo diffs saved as \"src/mailtime.D\"
else
echo applying diffs to file src/mailtime.c...
/bin/cat src/mailtime.D | /bin/ed - src/mailtime.c
fi
#-------------------------------------
# File 'src/opt_utils.c' diffs...
cat << 'EOF' > src/opt_utils.D
38a
#endif
#ifdef UTS
.
20c
#ifdef NEED_GETHOSTNAME
.
17,18c
# include <sys/tubio.h>
# define TTYIN 0 /* standard input */
#endif
.
13c
# include <pwd.h>
#else
# include <sys/utsname.h>
.
w
EOF
chars=`cat src/opt_utils.c | wc -c`
if [ $chars -ne 4997 ]
then
echo Your file src/opt_utils.c has been changed\!
echo diffs saved as \"src/opt_utils.D\"
else
echo applying diffs to file src/opt_utils.c...
/bin/cat src/opt_utils.D | /bin/ed - src/opt_utils.c
fi
#-------------------------------------
# File 'src/mailmsg2.c' diffs...
cat << 'EOF' > src/mailmsg2.D
405,406c
fprintf(filedesc,"From: %s <%s!%s>\n", full_username,
hostname, username);
.
401,402c
fprintf(filedesc,"From: %s <%s@%s>\n", full_username,
username, hostname);
.
398,399c
fprintf(filedesc,"From: %s <%s@%s%s>\n", full_username,
username, hostname, DOMAIN);
.
395a
# ifdef SITE_HIDING
if (is_a_hidden_user(username))
fprintf(filedesc,"From: %s <%s!%s!%s>\n", full_username,
hostname, HIDDEN_SITE_NAME, username);
else
# endif
.
390a
#ifdef SITE_HIDING
if (is_a_hidden_user(username)) {
/** this is the interesting part of this trick... **/
sprintf(buffer, "From %s!%s %s\n", HIDDEN_SITE_NAME,
username, get_ctime_date());
fprintf(filedesc, "%s", buffer);
dprint1(1,"\nadded: %s", buffer);
/** so is this perverted or what? **/
}
#endif
.
313c
printf("No\n\r\n\r");
/** try to save it as a dead letter file **/
sprintf(fname, "%s/%s", home, dead_letter);
if ((deadfd = fopen(fname,"a")) == NULL) {
dprint2(1,
"\nAttempt to append to deadletter file '%s' failed: %s\n",
fname, error_name(errno));
printf("Message not saved, Sorry.\n\r\n\r");
return('f');
}
else if ((messagefd = fopen(filename, "r")) == NULL) {
dprint2(1,"\nAttempt to read reply file '%s' failed: %s\n",
filename, error_name(errno));
printf("Message not saved, Sorry.\n\r\n\r");
return('f');
}
/* if we get here we're okay for everything, right? */
while (fgets(buffer, LONG_SLEN, messagefd) != NULL)
fputs(buffer, deadfd);
fclose(messagefd);
fclose(deadfd);
printf("Message saved in file \"$HOME/%s\"\n\n", dead_letter);
.
303c
FILE *deadfd, *messagefd;
char ch, buffer[LONG_SLEN], fname[SLEN];
.
301c
TRUE if everything is okay, FALSE if cancelled. Modified
compliments of Steve Wolf to add the'dead.letter' feature **/
.
298c
verify_transmission(filename)
char *filename;
.
199c
mailer, strip_parens(strip_commas(expanded_to)),
.
195c
sendmail, smflags, strip_parens(strip_commas(expanded_to)),
.
193c
if (access(sendmail, EXECUTE_ACCESS) == 0
#ifdef SITE_HIDING
&& ! is_a_hidden_user(username))
#else
)
#endif
.
178c
mailx, subject, strip_parens(strip_commas(expanded_to)),
.
155c
if (auto_cc && !batch)
.
139,140c
error1("Could not open reply file (%s)", error_name(errno));
return(1);
.
136c
dprint2(1,
.
133a
if ((reply = fopen(filename,"r")) == NULL) {
dprint2(1,
"Attempt to open file %s for reading failed with error %s (mail)\n",
filename, error_name(errno));
error1("Could not open reply file (%s)", error_name(errno));
return(1);
}
.
129c
if ((ch = verify_transmission(filename)) == 'f') { /* cancelled! */
.
124a
default : /* do nothing */ ;
.
121c
******************************************************************************/
.
112c
/*****************************************************************************
case 'e' : if (edit_message) edit_the_message(filename);
/** now let's try reading it again...
(void) fclose(reply); /* make sure it's closed
.
110c
case 'e' : edit_the_message(filename); break;
.
108d
103c
ch = edit_message? 'e' : ' '; /* drop through if needed... */
.
78c
fprintf(reply, "%s\n", very_long_buffer);
.
75d
71d
40c
char ch;
.
14c
char *format_long(), *strip_commas(), *tail_of_string();
#ifdef SITE_HIDING
char *get_ctime_date();
#endif
.
w
EOF
chars=`cat src/mailmsg2.c | wc -c`
if [ $chars -ne 14200 ]
then
echo Your file src/mailmsg2.c has been changed\!
echo diffs saved as \"src/mailmsg2.D\"
else
echo applying diffs to file src/mailmsg2.c...
/bin/cat src/mailmsg2.D | /bin/ed - src/mailmsg2.c
fi
#-------------------------------------
# File 'src/savecopy.c' diffs...
cat << 'EOF' > src/savecopy.D
100c
thetime = (long) time((long *) 0); /* dumb dumb dumb routine */
.
52c
if (can_access(savename, READ_ACCESS) != 0)
.
10a
# endif
.
9a
# ifdef BSD4.1
# include <time.h>
# else
.
w
EOF
chars=`cat src/savecopy.c | wc -c`
if [ $chars -ne 4059 ]
then
echo Your file src/savecopy.c has been changed\!
echo diffs saved as \"src/savecopy.D\"
else
echo applying diffs to file src/savecopy.c...
/bin/cat src/savecopy.D | /bin/ed - src/savecopy.c
fi
#-------------------------------------
# File 'src/mailmsg1.c' diffs...
cat << 'EOF' > src/mailmsg1.D
245c
printf("To: %s\n\r", format_long(address, 3));
.
w
EOF
chars=`cat src/mailmsg1.c | wc -c`
if [ $chars -ne 6587 ]
then
echo Your file src/mailmsg1.c has been changed\!
echo diffs saved as \"src/mailmsg1.D\"
else
echo applying diffs to file src/mailmsg1.c...
/bin/cat src/mailmsg1.D | /bin/ed - src/mailmsg1.c
fi
#-------------------------------------
# File 'src/connect_to.c' diffs...
cat << 'EOF' > src/connect_to.D
128c
system_record = (struct lsys_rec *) pmalloc(sizeof *talk_to_sys);
.
115c
previous_record = (struct lsys_rec *) pmalloc(sizeof *talk_to_sys);
.
61c
system_record = (struct lsys_rec *) pmalloc(sizeof *talk_to_sys);
.
48c
previous_record = (struct lsys_rec *) pmalloc(sizeof *talk_to_sys);
.
13a
char *pmalloc();
.
w
EOF
chars=`cat src/connect_to.c | wc -c`
if [ $chars -ne 3887 ]
then
echo Your file src/connect_to.c has been changed\!
echo diffs saved as \"src/connect_to.D\"
else
echo applying diffs to file src/connect_to.c...
/bin/cat src/connect_to.D | /bin/ed - src/connect_to.c
fi
#-------------------------------------
# File 'src/errno.c' diffs...
cat << 'EOF' > src/errno.c.D
74,75d
60,61d
w
EOF
chars=`cat src/errno.c | wc -c`
if [ $chars -ne 2612 ]
then
echo Your file src/errno.c has been changed\!
echo diffs saved as \"src/errno.c.D\"
else
echo applying diffs to file src/errno.c...
/bin/cat src/errno.c.D | /bin/ed - src/errno.c
fi
#-------------------------------------
# File 'src/options.c' diffs...
cat << 'EOF' > src/options.D
52c
"This is the program invoked to display individual messages (try 'builtin')");
.
w
EOF
chars=`cat src/options.c | wc -c`
if [ $chars -ne 7702 ]
then
echo Your file src/options.c has been changed\!
echo diffs saved as \"src/options.D\"
else
echo applying diffs to file src/options.c...
/bin/cat src/options.D | /bin/ed - src/options.c
fi
#-------------------------------------
# File 'src/elm.c' diffs...
cat << 'EOF' > src/elm.c.D
105c
if (move_when_paged && header_page >= 0)
.
100c
header_page <=(message_count / headers_per_page))
.
34c
format_long(to_whom, 3));
.
31a
#ifdef BSD4.1
initscr();
#endif
.
27a
#ifdef BSD
InitScreen();
#endif
.
10a
#ifdef BSD
# undef toupper
# undef tolower
#endif
.
w
EOF
chars=`cat src/elm.c | wc -c`
if [ $chars -ne 15852 ]
then
echo Your file src/elm.c has been changed\!
echo diffs saved as \"src/elm.c.D\"
else
echo applying diffs to file src/elm.c...
/bin/cat src/elm.c.D | /bin/ed - src/elm.c
fi
#---------------------------------
# File Elm/src/builtin.c is new!
echo File Elm/src/builtin.c is new - extracting...
if [ -f src/builtin.c ]
then
echo File \'src/builtin.c\' is new, but you already have something called that\!
echo I\'m going to move your file to \'src/builtin.c.old\'...
/bin/mv -f src/builtin.c src/builtin.c.old
else
echo Extracting new file \'src/builtin.c\'
fi
cat > src/builtin.c << 'END_OF_FILE'
/** builtin.c **/
/** This is the built-in pager for displaying messages while in the Elm
program. It's a bare-bones pager with precious few options. The idea
is that those systems that are sufficiently slow that using an external
pager such as 'more' is too slow, then they can use this!
(C) Copyright 1986, Dave Taylor
**/
#include "headers.h"
#include <ctype.h>
#define BEEP 007 /* ASCII Bell character */
#ifdef BSD
# undef tolower
#endif
int lines_put_on_screen = 0, /* number of lines displayed per screen */
lines_displayed = 0, /* Total number of lines displayed */
total_lines_to_display; /* total number of lines in message */
start_builtin(lines_in_message)
int lines_in_message;
{
/** clears that screen and resets it's internal counters... **/
dprint1(8,"displaying %d lines from message using internal pager\n",
lines_in_message);
lines_displayed = 0;
lines_put_on_screen = 0;
total_lines_to_display = lines_in_message;
}
int
display_line(line)
char *line;
{
/** Display the given line on the screen, taking into account such
dumbness as wraparound and such. If displaying this would put
us at the end of the screen, put out the "MORE" prompt and wait
for some input. Return non-zero if the user terminates the
paging (e.g. 'q') or zero if we should continue...
**/
register int lines_needed, okay_char, ch;
lines_needed = (int) (printable_chars(line) / COLUMNS); /* wraparound */
for (ch = 0; ch < strlen(line); ch++)
if (line[ch] == '\n') lines_needed++;
dprint1(6,"* display-line \"%s\"\n", line);
dprint2(7,"** at line %d of the screen (%d available)\n",
lines_put_on_screen, LINES-1);
if (lines_needed + lines_put_on_screen > LINES-1) {
dprint2(9,"** need CR: lines on screen = %d, need %d\n", lines_needed,
lines_put_on_screen);
StartBold();
Write_to_screen(" More (%d%%)", 1,
(int) (100.0 * (
(float) lines_displayed / (float) total_lines_to_display)));
EndBold();
okay_char = FALSE;
do {
Raw(ON);
ch = tolower(ReadCh());
Raw(OFF);
switch (ch) {
case '\n' :
case '\r' : /* <return> pressed... */
lines_put_on_screen -= lines_needed;
okay_char = TRUE;
break;
case ' ' : /* <space> pressed... */
lines_put_on_screen = 0;
okay_char = TRUE;
break;
case 'q' :
case 'Q' : return(TRUE); /* get OUTTA here! */
default : putchar(BEEP);
fflush(stdout);
break;
}
} while (! okay_char);
CursorLeft(11); /* back up to the beginning of line */
CleartoEOLN();
}
Write_to_screen("%s", 1, line);
lines_displayed += 1; /* tossed on screen */
lines_put_on_screen += lines_needed; /* read from file */
return (FALSE);
}
END_OF_FILE
chars=`cat src/builtin.c | wc -c`
if [ $chars -ne 2825 ]
then
echo File damaged in transit...should be 2825 bytes, is $chars instead
echo I suggest you check it closely...
fi
#-------------------------------------
# File 'src/getopt.c' diffs...
cat << 'EOF' > src/getopt.c.D
83c
if (word == NULL)
return(ERROR); /* Sun compatibility */
if (word == NULL || strlen(word) == 0)
.
71,75d
66c
if (_argnum >= argc) {
.
61,64d
57c
if (_indx > strlen(argv[_argnum]) == NULL && _indx > 1) {
.
52c
if (_argnum >= argc) { /* quick check first - no arguments! */
.
18a
.
7a
#include "defs.h"
.
w
EOF
chars=`cat src/getopt.c | wc -c`
if [ $chars -ne 2253 ]
then
echo Your file src/getopt.c has been changed\!
echo diffs saved as \"src/getopt.c.D\"
else
echo applying diffs to file src/getopt.c...
/bin/cat src/getopt.c.D | /bin/ed - src/getopt.c
fi
echo end of autodiff, part 1
exit 0