version 1.132, 2007/09/10 10:29:12 |
version 1.133, 2007/09/19 11:53:27 |
|
|
static void |
static void |
cvs_read_rcfile(void) |
cvs_read_rcfile(void) |
{ |
{ |
char rcpath[MAXPATHLEN], linebuf[128], *lp, *p; |
char rcpath[MAXPATHLEN], *buf, *lbuf, *lp, *p; |
int i, linenum; |
int i, linenum; |
size_t len; |
size_t len; |
struct cvs_cmd *cmdp; |
struct cvs_cmd *cmdp; |
|
|
return; |
return; |
} |
} |
|
|
while (fgets(linebuf, (int)sizeof(linebuf), fp) != NULL) { |
lbuf = NULL; |
linenum++; |
while ((buf = fgetln(fp, &len)) != NULL) { |
if ((len = strlen(linebuf)) == 0) |
if (buf[len - 1] == '\n') { |
continue; |
buf[len - 1] = '\0'; |
if (linebuf[len - 1] != '\n') { |
} else { |
cvs_log(LP_ERR, "line too long in `%s:%d'", rcpath, |
lbuf = xmalloc(len + 1); |
linenum); |
memcpy(lbuf, buf, len); |
break; |
lbuf[len] = '\0'; |
|
buf = lbuf; |
} |
} |
linebuf[--len] = '\0'; |
|
|
|
|
linenum++; |
|
|
/* skip any whitespaces */ |
/* skip any whitespaces */ |
p = linebuf; |
p = buf; |
while (*p == ' ') |
while (*p == ' ') |
p++; |
p++; |
|
|
|
|
cmdp->cmd_defargs = xstrdup(lp); |
cmdp->cmd_defargs = xstrdup(lp); |
} |
} |
} |
} |
|
if (lbuf != NULL) |
|
xfree(lbuf); |
|
|
if (ferror(fp)) { |
if (ferror(fp)) { |
cvs_log(LP_NOTICE, "failed to read line from `%s'", rcpath); |
cvs_log(LP_NOTICE, "failed to read line from `%s'", rcpath); |