version 1.69, 2005/06/01 17:44:34 |
version 1.70, 2005/06/10 13:34:23 |
|
|
static void |
static void |
cvs_read_rcfile(void) |
cvs_read_rcfile(void) |
{ |
{ |
char rcpath[MAXPATHLEN], linebuf[128], *lp; |
char rcpath[MAXPATHLEN], linebuf[128], *lp, *p; |
int l, linenum = 0; |
int l, linenum = 0; |
size_t len; |
size_t len; |
struct cvs_cmd *cmdp; |
struct cvs_cmd *cmdp; |
|
|
} |
} |
linebuf[--len] = '\0'; |
linebuf[--len] = '\0'; |
|
|
lp = strchr(linebuf, ' '); |
/* skip any whitespaces */ |
|
p = linebuf; |
|
while (*p == ' ') |
|
*p++; |
|
|
|
/* allow comments */ |
|
if (*p == '#') |
|
continue; |
|
|
|
lp = strchr(p, ' '); |
if (lp == NULL) |
if (lp == NULL) |
continue; /* ignore lines with no arguments */ |
continue; /* ignore lines with no arguments */ |
*lp = '\0'; |
*lp = '\0'; |
if (strcmp(linebuf, "cvs") == 0) { |
if (strcmp(p, "cvs") == 0) { |
/* |
/* |
* 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 |
|
|
* argument processing. |
* argument processing. |
*/ |
*/ |
*lp = ' '; |
*lp = ' '; |
cvs_defargs = strdup(linebuf); |
cvs_defargs = strdup(p); |
if (cvs_defargs == NULL) |
if (cvs_defargs == NULL) |
cvs_log(LP_ERRNO, |
cvs_log(LP_ERRNO, |
"failed to copy global arguments"); |
"failed to copy global arguments"); |
} else { |
} else { |
lp++; |
lp++; |
cmdp = cvs_findcmd(linebuf); |
cmdp = cvs_findcmd(p); |
if (cmdp == NULL) { |
if (cmdp == NULL) { |
cvs_log(LP_NOTICE, |
cvs_log(LP_NOTICE, |
"unknown command `%s' in `%s:%d'", |
"unknown command `%s' in `%s:%d'", |
linebuf, rcpath, linenum); |
p, rcpath, linenum); |
continue; |
continue; |
} |
} |
|
|