cudcv@warwick.ac.uk (Rob McMahon) (12/20/88)
Both `frm' and `newmail' fail to compile on some systems, `frm' because the
Makefile doesn't specify `../src/getopt.o', `newmail' because it tries to use
the system getopt, which on at least one of our systems doesn't define opterr.
Fix is to change the Makefile to use `../src/getopt.o' for both `frm' and
`newmail', and change newmail.c to use the supplied getopt.
--
RCS file: /usr/local/src/elm/utils/newmail.c,v
retrieving revision 2.1.1.1
retrieving revision 2.1.1.2
diff -c -r2.1.1.1 -r2.1.1.2
*** /tmp/,RCSt1a02943 Tue Dec 20 12:37:01 1988
--- /tmp/,RCSt2a02943 Tue Dec 20 12:37:05 1988
***************
*** 131,138 ****
int argc;
char *argv[];
{
! extern char *optarg;
! extern int optind, opterr;
char *ptr;
int c, i, done;
long lastsize,
--- 134,141 ----
int argc;
char *argv[];
{
! extern char *optional_arg;
! extern int opt_index;
char *ptr;
int c, i, done;
long lastsize,
***************
*** 139,145 ****
newsize; /* file size for comparison.. */
interval_time = DEFAULT_INTERVAL;
- opterr = 0;
/** let's see if the first character of the basename of the
command invoked is a 'w' (e.g. have we been called as
--- 142,147 ----
***************
*** 158,164 ****
while ((c = getopt(argc, argv, "di:w")) != EOF) {
switch (c) {
case 'd' : debug++; break;
! case 'i' : interval_time = atoi(optarg); break;
case 'w' : in_window = 1; break;
default : usage(); exit(1);
}
--- 160,166 ----
while ((c = getopt(argc, argv, "di:w")) != EOF) {
switch (c) {
case 'd' : debug++; break;
! case 'i' : interval_time = atoi(optional_arg); break;
case 'w' : in_window = 1; break;
default : usage(); exit(1);
}
***************
*** 171,181 ****
/* now let's parse the foldernames, if any are given */
! if (optind >= argc) /* get default */
add_default_folder();
else {
! while (optind < argc)
! add_folder(argv[optind++]);
pad_prefixes(); /* for nice output...*/
}
--- 173,183 ----
/* now let's parse the foldernames, if any are given */
! if (opt_index >= argc) /* get default */
add_default_folder();
else {
! while (opt_index < argc)
! add_folder(argv[opt_index++]);
pad_prefixes(); /* for nice output...*/
}
--
Rob
--
UUCP: ...!mcvax!ukc!warwick!cudcv PHONE: +44 203 523037
JANET: cudcv@uk.ac.warwick ARPA: cudcv@warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England