14 |
* Determine the path to the CVSROOT and set "Root" accordingly. |
* Determine the path to the CVSROOT and set "Root" accordingly. |
15 |
*/ |
*/ |
16 |
|
|
17 |
|
#ifdef HAVE_CONFIG_H |
18 |
|
# include <config.h> |
19 |
|
#endif |
20 |
|
|
21 |
|
/* Verify interface. */ |
22 |
|
#include "root.h" |
23 |
|
|
24 |
#include "cvs.h" |
#include "cvs.h" |
25 |
#include <assert.h> |
#include <assert.h> |
26 |
#include "getline.h" |
#include "getline.h" |
27 |
|
|
28 |
|
#include "stack.h" |
29 |
|
|
30 |
/* Printable names for things in the current_parsed_root->method enum variable. |
/* Printable names for things in the current_parsed_root->method enum variable. |
31 |
Watch out if the enum is changed in cvs.h! */ |
Watch out if the enum is changed in cvs.h! */ |
32 |
|
|
392 |
newroot->directory = NULL; |
newroot->directory = NULL; |
393 |
newroot->method = null_method; |
newroot->method = null_method; |
394 |
newroot->isremote = false; |
newroot->isremote = false; |
395 |
|
newroot->sign = SIGN_DEFAULT; |
396 |
|
newroot->sign_template = xstrdup (DEFAULT_SIGN_TEMPLATE); |
397 |
|
newroot->sign_textmode = xstrdup (DEFAULT_SIGN_TEXTMODE); |
398 |
|
newroot->sign_args = getlist (); |
399 |
#ifdef CLIENT_SUPPORT |
#ifdef CLIENT_SUPPORT |
400 |
newroot->username = NULL; |
newroot->username = NULL; |
401 |
newroot->password = NULL; |
newroot->password = NULL; |
427 |
free (root->original); |
free (root->original); |
428 |
if (root->directory != NULL) |
if (root->directory != NULL) |
429 |
free (root->directory); |
free (root->directory); |
430 |
|
if (root->sign_template) |
431 |
|
free (root->sign_template); |
432 |
|
if (root->sign_textmode) |
433 |
|
free (root->sign_textmode); |
434 |
|
dellist (&root->sign_args); |
435 |
#ifdef CLIENT_SUPPORT |
#ifdef CLIENT_SUPPORT |
436 |
if (root->username != NULL) |
if (root->username != NULL) |
437 |
free (root->username); |
free (root->username); |
580 |
while ((p = strtok (NULL, ";"))) |
while ((p = strtok (NULL, ";"))) |
581 |
{ |
{ |
582 |
char *q = strchr (p, '='); |
char *q = strchr (p, '='); |
583 |
if (q == NULL) |
if (!q && (strcasecmp (p, "sign") || strcasecmp (p, "no-sign"))) |
584 |
{ |
{ |
585 |
error (0, 0, "Option (`%s') has no argument in CVSROOT.", |
error (0, 0, "Option (`%s') has no argument in CVSROOT.", |
586 |
p); |
p); |
612 |
"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').", |
613 |
q); |
q); |
614 |
} |
} |
615 |
|
else if (!strcasecmp (p, "sign")) |
616 |
|
{ |
617 |
|
if (!q) |
618 |
|
newroot->sign = SIGN_ALWAYS; |
619 |
|
else if (!strcasecmp (q, "auto") || !strcasecmp (q, "server")) |
620 |
|
newroot->sign = SIGN_DEFAULT; |
621 |
|
else |
622 |
|
{ |
623 |
|
bool on; |
624 |
|
if (readBool ("CVSROOT", "sign", q, &on)) |
625 |
|
{ |
626 |
|
if (on) |
627 |
|
newroot->sign = SIGN_ALWAYS; |
628 |
|
else |
629 |
|
newroot->sign = SIGN_NEVER; |
630 |
|
} |
631 |
|
else |
632 |
|
goto error_exit; |
633 |
|
} |
634 |
|
} |
635 |
|
else if (!strcasecmp (p, "no-sign")) |
636 |
|
newroot->sign = SIGN_NEVER; |
637 |
|
else if (!strcasecmp (p, "sign-template")) |
638 |
|
newroot->sign_template = xstrdup (q); |
639 |
|
else if (!strcasecmp (p, "sign-textmode")) |
640 |
|
newroot->sign_textmode = xstrdup (q); |
641 |
|
else if (!strcasecmp (p, "sign-arg")) |
642 |
|
push_string (newroot->sign_args, q); |
643 |
else if (!strcasecmp (p, "CVS_RSH")) |
else if (!strcasecmp (p, "CVS_RSH")) |
644 |
{ |
{ |
645 |
/* override CVS_RSH environment variable */ |
/* override CVS_RSH environment variable */ |