18 |
#include <assert.h> |
#include <assert.h> |
19 |
#include "getline.h" |
#include "getline.h" |
20 |
|
|
21 |
|
#include "stack.h" |
22 |
|
|
23 |
/* Printable names for things in the current_parsed_root->method enum variable. |
/* Printable names for things in the current_parsed_root->method enum variable. |
24 |
Watch out if the enum is changed in cvs.h! */ |
Watch out if the enum is changed in cvs.h! */ |
25 |
|
|
385 |
newroot->directory = NULL; |
newroot->directory = NULL; |
386 |
newroot->method = null_method; |
newroot->method = null_method; |
387 |
newroot->isremote = false; |
newroot->isremote = false; |
388 |
|
newroot->sign = SIGN_DEFAULT; |
389 |
|
newroot->sign_template = xstrdup (DEFAULT_SIGN_TEMPLATE); |
390 |
|
newroot->sign_textmode = xstrdup (DEFAULT_SIGN_TEXTMODE); |
391 |
|
newroot->sign_args = getlist (); |
392 |
#ifdef CLIENT_SUPPORT |
#ifdef CLIENT_SUPPORT |
393 |
newroot->username = NULL; |
newroot->username = NULL; |
394 |
newroot->password = NULL; |
newroot->password = NULL; |
420 |
free (root->original); |
free (root->original); |
421 |
if (root->directory != NULL) |
if (root->directory != NULL) |
422 |
free (root->directory); |
free (root->directory); |
423 |
|
if (root->sign_template) |
424 |
|
free (root->sign_template); |
425 |
|
if (root->sign_textmode) |
426 |
|
free (root->sign_textmode); |
427 |
|
dellist (&root->sign_args); |
428 |
#ifdef CLIENT_SUPPORT |
#ifdef CLIENT_SUPPORT |
429 |
if (root->username != NULL) |
if (root->username != NULL) |
430 |
free (root->username); |
free (root->username); |
573 |
while ((p = strtok (NULL, ";"))) |
while ((p = strtok (NULL, ";"))) |
574 |
{ |
{ |
575 |
char *q = strchr (p, '='); |
char *q = strchr (p, '='); |
576 |
if (q == NULL) |
if (!q && (strcasecmp (p, "sign") || strcasecmp (p, "nosign"))) |
577 |
{ |
{ |
578 |
error (0, 0, "Option (`%s') has no argument in CVSROOT.", |
error (0, 0, "Option (`%s') has no argument in CVSROOT.", |
579 |
p); |
p); |
605 |
"CVSROOT may only specify a positive, non-zero, integer proxy port (not `%s').", |
"CVSROOT may only specify a positive, non-zero, integer proxy port (not `%s').", |
606 |
q); |
q); |
607 |
} |
} |
608 |
|
else if (!strcasecmp (p, "sign")) |
609 |
|
{ |
610 |
|
if (!q) |
611 |
|
newroot->sign = SIGN_ALWAYS; |
612 |
|
else if (!strcasecmp (q, "default")) |
613 |
|
newroot->sign = SIGN_DEFAULT; |
614 |
|
else |
615 |
|
{ |
616 |
|
bool on; |
617 |
|
if (readBool ("CVSROOT", "sign", q, &on)) |
618 |
|
{ |
619 |
|
if (on) |
620 |
|
newroot->sign = SIGN_ALWAYS; |
621 |
|
else |
622 |
|
newroot->sign = SIGN_NEVER; |
623 |
|
} |
624 |
|
else |
625 |
|
goto error_exit; |
626 |
|
} |
627 |
|
} |
628 |
|
else if (!strcasecmp (p, "nosign")) |
629 |
|
newroot->sign = SIGN_NEVER; |
630 |
|
else if (!strcasecmp (p, "sign-template")) |
631 |
|
newroot->sign_template = xstrdup (q); |
632 |
|
else if (!strcasecmp (p, "sign-textmode")) |
633 |
|
newroot->sign_textmode = xstrdup (q); |
634 |
|
else if (!strcasecmp (p, "sign-arg")) |
635 |
|
push_string (newroot->sign_args, q); |
636 |
else if (!strcasecmp (p, "CVS_RSH")) |
else if (!strcasecmp (p, "CVS_RSH")) |
637 |
{ |
{ |
638 |
/* override CVS_RSH environment variable */ |
/* override CVS_RSH environment variable */ |