version 1.136, 2007/09/19 12:48:41 |
version 1.137, 2007/09/19 13:36:32 |
|
|
cvs_read_rcfile(void) |
cvs_read_rcfile(void) |
{ |
{ |
char rcpath[MAXPATHLEN], *buf, *lbuf, *lp, *p; |
char rcpath[MAXPATHLEN], *buf, *lbuf, *lp, *p; |
int i, linenum; |
int cmd_parsed, cvs_parsed, i, linenum; |
size_t len, pos; |
size_t len, pos; |
struct cvs_cmd *cmdp; |
struct cvs_cmd *cmdp, *tcmdp; |
FILE *fp; |
FILE *fp; |
|
|
linenum = 0; |
linenum = 0; |
|
|
return; |
return; |
} |
} |
|
|
|
cmdp = cvs_findcmd(cvs_command); |
|
if (cmdp == NULL) |
|
fatal("unknown command `%s'", cvs_command); |
|
|
|
cmd_parsed = cvs_parsed = 0; |
lbuf = NULL; |
lbuf = NULL; |
while ((buf = fgetln(fp, &len)) != NULL) { |
while ((buf = fgetln(fp, &len)) != NULL) { |
if (buf[len - 1] == '\n') { |
if (buf[len - 1] == '\n') { |
|
|
*lp = '\0'; |
*lp = '\0'; |
} |
} |
|
|
if (strcmp(p, "cvs") == 0) { |
if (strcmp(p, "cvs") == 0 && !cvs_parsed) { |
/* |
/* |
* Global default options. In the case of cvs only, |
* Global default options. In the case of cvs only, |
* we keep the 'cvs' string as first argument because |
* we keep the 'cvs' string as first argument because |
|
|
*/ |
*/ |
*lp = ' '; |
*lp = ' '; |
cvs_defargs = xstrdup(p); |
cvs_defargs = xstrdup(p); |
|
cvs_parsed = 1; |
} else { |
} else { |
lp++; |
lp++; |
cmdp = cvs_findcmd(p); |
tcmdp = cvs_findcmd(p); |
if (cmdp == NULL) { |
if (tcmdp == NULL && verbosity == 2) |
if (verbosity == 2) |
cvs_log(LP_NOTICE, |
cvs_log(LP_NOTICE, |
"unknown command `%s' in `%s:%d'", |
"unknown command `%s' in `%s:%d'", |
p, rcpath, linenum); |
p, rcpath, linenum); |
|
|
if (tcmdp != cmdp || cmd_parsed) |
continue; |
continue; |
} |
|
|
|
cmdp->cmd_defargs = xstrdup(lp); |
cmdp->cmd_defargs = xstrdup(lp); |
|
cmd_parsed = 1; |
} |
} |
} |
} |
if (lbuf != NULL) |
if (lbuf != NULL) |