--- lmtp2nntp_option.c 2003/02/11 09:35:22 1.26
+++ lmtp2nntp_option.c 2003/02/11 10:00:48 1.27
@@ -427,13 +427,22 @@
struct stat sb;
volatile int fd = -1;
ex_t ex;
+ char *cpI; /* pointer to next character to be read */
+ char *cpO; /* pointer to next character to be written. Used for eliminating backslash+newline at a line continuation */
+ char *cpL; /* pointer to start of line */
+ int pline; /* current physical (disregarding line continuation) line number */
+ int lline; /* current logical lines first physical line number */
+ int eline; /* flag signaling empty or just whitespace-filled line */
+ char c; /* current character */
+ char p; /* previous character */
+ int eof; /* flag signaling end of file detected */
if ((o = oc->parent) == NULL)
return OPTION_ERR_USE;
- stdsyntax(oc, arg, cbctx);
-
try {
+ if (stdsyntax(oc, arg, cbctx) != OPTION_OK)
+ throw(0, 0, 0);
if (stat(filename, &sb) == -1)
throw(includeit, oc, "stat");
if (sb.st_size == 0)
@@ -444,30 +453,6 @@
if (read(fd, (void *)cpBuf, (size_t)sb.st_size) != (ssize_t)sb.st_size)
throw(includeit, oc, "read");
cpBuf[(int)sb.st_size] = '\0';
- }
- cleanup {
- if (fd != -1) close(fd);
- }
- catch (ex) {
- if (ex.ex_class == (void *)includeit && ex.ex_value != NULL) {
- fprintf(stderr, "ERROR: problem with \"%s\" while including \"%s\"\n", (char *)ex.ex_value, filename);
- }
- if (cpBuf != NULL)
- free((char *)cpBuf);
- return OPTION_ERR_TRY;
- }
-
- try {
- char *cpI; /* pointer to next character to be read */
- char *cpO; /* pointer to next character to be written. Used for eliminating
- backslash+newline at a line continuation */
- char *cpL; /* pointer to start of line */
- int pline; /* current physical (disregarding line continuation) line number */
- int lline; /* current logical lines first physical line number */
- int eline; /* flag signaling empty or just whitespace-filled line */
- char c; /* current character */
- char p; /* previous character */
- int eof; /* flag signaling end of file detected */
cpI = (char *)cpBuf;
cpO = (char *)cpBuf;
@@ -549,13 +534,19 @@
}
cleanup {
int i;
+ if (fd != -1) close(fd);
if (argv != NULL) {
for (i = 0; argv[i] != NULL; i++)
free(argv[i]);
free(argv);
}
+ if (cpBuf != NULL)
+ free((char *)cpBuf);
}
catch(ex) {
+ if (ex.ex_class == (void *)includeit && ex.ex_value != NULL) {
+ fprintf(stderr, "ERROR: problem with \"%s\" while including \"%s\"\n", (char *)ex.ex_value, filename);
+ }
rc = OPTION_ERR_TRY;
}
return rc;
|