Index: ChangeLog =================================================================== RCS file: /sources/cvs/ccvs/ChangeLog,v retrieving revision 1.1379 diff -u -r1.1379 ChangeLog --- ChangeLog 12 Nov 2009 02:29:17 -0000 1.1379 +++ ChangeLog 23 Mar 2013 17:50:07 -0000 @@ -1,3 +1,8 @@ +2013-03-23 Bill Pries + + * root.c: Support CR/LF as well as LF + * repos.c: Support CR/LF as well as LF + 2009-11-11 Derek R. Price * NEWS: Note default taginfo format string fix. Index: src/repos.c =================================================================== RCS file: /sources/cvs/ccvs/src/repos.c,v retrieving revision 1.49 diff -u -r1.49 repos.c --- src/repos.c 18 Nov 2008 22:56:55 -0000 1.49 +++ src/repos.c 23 Mar 2013 17:50:08 -0000 @@ -101,6 +101,9 @@ error (0, errno, "cannot close %s", quote (tmp)); free (tmp); + if ((cp = strrchr (repos, '\r')) != NULL) + *cp = '\0'; /* strip the carriage return */ + if ((cp = strrchr (repos, '\n')) != NULL) *cp = '\0'; /* strip the newline */ Index: src/root.c =================================================================== RCS file: /sources/cvs/ccvs/src/root.c,v retrieving revision 1.137 diff -u -r1.137 root.c --- src/root.c 12 Sep 2008 19:55:29 -0000 1.137 +++ src/root.c 23 Mar 2013 17:50:08 -0000 @@ -60,7 +60,6 @@ char *tmp; char *cvsadm; char *cp; - int len; TRACE (TRACE_FLOW, "Name_Root (%s, %s)", TRACE_NULL (dir), TRACE_NULL (update_dir)); @@ -88,7 +87,7 @@ */ fpin = xfopen (tmp, "r"); - if ((len = getline (&root, &root_allocated, fpin)) < 0) + if (getline (&root, &root_allocated, fpin) < 0) { char *admfile = dir_append (update_dir, CVSADM_ROOT); /* FIXME: should be checking for end of file separately; errno @@ -99,8 +98,11 @@ goto out; } fclose (fpin); - cp = root + len - 1; - if (*cp == '\n') + + if ((cp = strrchr (root, '\r')) != NULL) + *cp = '\0'; /* strip the carriage return */ + + if ((cp = strrchr (root, '\n')) != NULL) *cp = '\0'; /* strip the newline */ /*