=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/cvs.c,v retrieving revision 1.69 retrieving revision 1.70 diff -c -r1.69 -r1.70 *** src/usr.bin/cvs/cvs.c 2005/06/01 17:44:34 1.69 --- src/usr.bin/cvs/cvs.c 2005/06/10 13:34:23 1.70 *************** *** 1,4 **** ! /* $OpenBSD: cvs.c,v 1.69 2005/06/01 17:44:34 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: cvs.c,v 1.70 2005/06/10 13:34:23 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. *************** *** 325,331 **** static void cvs_read_rcfile(void) { ! char rcpath[MAXPATHLEN], linebuf[128], *lp; int l, linenum = 0; size_t len; struct cvs_cmd *cmdp; --- 325,331 ---- static void cvs_read_rcfile(void) { ! char rcpath[MAXPATHLEN], linebuf[128], *lp, *p; int l, linenum = 0; size_t len; struct cvs_cmd *cmdp; *************** *** 364,374 **** } linebuf[--len] = '\0'; ! lp = strchr(linebuf, ' '); if (lp == NULL) continue; /* ignore lines with no arguments */ *lp = '\0'; ! if (strcmp(linebuf, "cvs") == 0) { /* * Global default options. In the case of cvs only, * we keep the 'cvs' string as first argument because --- 364,383 ---- } linebuf[--len] = '\0'; ! /* skip any whitespaces */ ! p = linebuf; ! while (*p == ' ') ! *p++; ! ! /* allow comments */ ! if (*p == '#') ! continue; ! ! lp = strchr(p, ' '); if (lp == NULL) continue; /* ignore lines with no arguments */ *lp = '\0'; ! if (strcmp(p, "cvs") == 0) { /* * Global default options. In the case of cvs only, * we keep the 'cvs' string as first argument because *************** *** 376,392 **** * argument processing. */ *lp = ' '; ! cvs_defargs = strdup(linebuf); if (cvs_defargs == NULL) cvs_log(LP_ERRNO, "failed to copy global arguments"); } else { lp++; ! cmdp = cvs_findcmd(linebuf); if (cmdp == NULL) { cvs_log(LP_NOTICE, "unknown command `%s' in `%s:%d'", ! linebuf, rcpath, linenum); continue; } --- 385,401 ---- * argument processing. */ *lp = ' '; ! cvs_defargs = strdup(p); if (cvs_defargs == NULL) cvs_log(LP_ERRNO, "failed to copy global arguments"); } else { lp++; ! cmdp = cvs_findcmd(p); if (cmdp == NULL) { cvs_log(LP_NOTICE, "unknown command `%s' in `%s:%d'", ! p, rcpath, linenum); continue; }