[BACK]Return to root.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / cvs

Diff for /src/usr.bin/cvs/root.c between version 1.12 and 1.13

version 1.12, 2004/12/06 21:03:13 version 1.13, 2004/12/07 17:10:56
Line 1 
Line 1 
 /*      $OpenBSD$       */  /*      $OpenBSD$       */
 /*  /*
  * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>   * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
  * All rights reserved.   * All rights reserved.
  *   *
  * Redistribution and use in source and binary forms, with or without   * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions   * modification, are permitted provided that the following conditions
  * are met:   * are met:
  *   *
  * 1. Redistributions of source code must retain the above copyright   * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.   *    notice, this list of conditions and the following disclaimer.
  * 2. The name of the author may not be used to endorse or promote products   * 2. The name of the author may not be used to endorse or promote products
  *    derived from this software without specific prior written permission.   *    derived from this software without specific prior written permission.
  *   *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY   * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
Line 21 
Line 21 
  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,   * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR   * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF   * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */   */
   
 #include <sys/types.h>  #include <sys/types.h>
Line 81 
Line 81 
  * Returns a pointer to the allocated information on success, or NULL   * Returns a pointer to the allocated information on success, or NULL
  * on failure.   * on failure.
  */   */
   
 struct cvsroot*  struct cvsroot*
 cvsroot_parse(const char *str)  cvsroot_parse(const char *str)
 {  {
Line 229 
Line 228 
  * Free a CVSROOT structure previously allocated and returned by   * Free a CVSROOT structure previously allocated and returned by
  * cvsroot_parse().   * cvsroot_parse().
  */   */
   
 void  void
 cvsroot_free(struct cvsroot *root)  cvsroot_free(struct cvsroot *root)
 {  {
Line 256 
Line 254 
  * 2) the CVS/Root file found in checked-out trees   * 2) the CVS/Root file found in checked-out trees
  * 3) the CVSROOT environment variable   * 3) the CVSROOT environment variable
  */   */
   
 struct cvsroot*  struct cvsroot*
 cvsroot_get(const char *dir)  cvsroot_get(const char *dir)
 {  {
Line 290 
Line 287 
         (void)fclose(fp);          (void)fclose(fp);
   
         len = strlen(line);          len = strlen(line);
         if (len == 0) {          if (len == 0)
                 cvs_log(LP_WARN, "empty CVS/Root file");                  cvs_log(LP_WARN, "empty CVS/Root file");
         } else if (line[len - 1] == '\n')          else if (line[len - 1] == '\n')
                 line[--len] = '\0';                  line[--len] = '\0';
   
         return cvsroot_parse(line);          return cvsroot_parse(line);

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13