version 1.2, 1996/06/11 12:53:38 |
version 1.3, 1997/07/13 21:21:11 |
|
|
{ |
{ |
int *msgvec = v; |
int *msgvec = v; |
|
|
return edit1(msgvec, 'e'); |
return(edit1(msgvec, 'e')); |
} |
} |
|
|
/* |
/* |
|
|
{ |
{ |
int *msgvec = v; |
int *msgvec = v; |
|
|
return edit1(msgvec, 'v'); |
return(edit1(msgvec, 'v')); |
} |
} |
|
|
/* |
/* |
|
|
char *p; |
char *p; |
|
|
printf("Edit message %d [ynq]? ", msgvec[i]); |
printf("Edit message %d [ynq]? ", msgvec[i]); |
if (fgets(buf, sizeof buf, stdin) == 0) |
if (fgets(buf, sizeof(buf), stdin) == 0) |
break; |
break; |
for (p = buf; *p == ' ' || *p == '\t'; p++) |
for (p = buf; *p == ' ' || *p == '\t'; p++) |
; |
; |
|
|
break; |
break; |
} |
} |
if (ferror(otf)) |
if (ferror(otf)) |
perror("/tmp"); |
warn("/tmp"); |
(void) Fclose(fp); |
(void)Fclose(fp); |
} |
} |
(void) signal(SIGINT, sigint); |
(void) signal(SIGINT, sigint); |
} |
} |
return 0; |
return(0); |
} |
} |
|
|
/* |
/* |
|
|
extern char *tempEdit; |
extern char *tempEdit; |
|
|
if ((t = creat(tempEdit, readonly ? 0400 : 0600)) < 0) { |
if ((t = creat(tempEdit, readonly ? 0400 : 0600)) < 0) { |
perror(tempEdit); |
warn(tempEdit); |
goto out; |
goto out; |
} |
} |
if ((nf = Fdopen(t, "w")) == NULL) { |
if ((nf = Fdopen(t, "w")) == NULL) { |
perror(tempEdit); |
warn(tempEdit); |
(void) unlink(tempEdit); |
(void) unlink(tempEdit); |
goto out; |
goto out; |
} |
} |
|
|
modtime = statb.st_mtime; |
modtime = statb.st_mtime; |
if (ferror(nf)) { |
if (ferror(nf)) { |
(void) Fclose(nf); |
(void) Fclose(nf); |
perror(tempEdit); |
warn(tempEdit); |
(void) unlink(tempEdit); |
(void) unlink(tempEdit); |
nf = NULL; |
nf = NULL; |
goto out; |
goto out; |
} |
} |
if (Fclose(nf) < 0) { |
if (Fclose(nf) < 0) { |
perror(tempEdit); |
warn(tempEdit); |
(void) unlink(tempEdit); |
(void) unlink(tempEdit); |
nf = NULL; |
nf = NULL; |
goto out; |
goto out; |
|
|
goto out; |
goto out; |
} |
} |
if (stat(tempEdit, &statb) < 0) { |
if (stat(tempEdit, &statb) < 0) { |
perror(tempEdit); |
warn(tempEdit); |
goto out; |
goto out; |
} |
} |
if (modtime == statb.st_mtime) { |
if (modtime == statb.st_mtime) { |
|
|
* Now switch to new file. |
* Now switch to new file. |
*/ |
*/ |
if ((nf = Fopen(tempEdit, "a+")) == NULL) { |
if ((nf = Fopen(tempEdit, "a+")) == NULL) { |
perror(tempEdit); |
warn(tempEdit); |
(void) unlink(tempEdit); |
(void) unlink(tempEdit); |
goto out; |
goto out; |
} |
} |
(void) unlink(tempEdit); |
(void) unlink(tempEdit); |
out: |
out: |
return nf; |
return(nf); |
} |
} |