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

Diff for /src/usr.bin/cvs/util.c between version 1.70 and 1.71

version 1.70, 2006/03/15 19:59:36 version 1.71, 2006/03/17 08:51:45
Line 1 
Line 1 
 /*      $OpenBSD$       */  /*      $OpenBSD$       */
 /*  /*
  * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>   * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
    * Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org>
    * Copyright (c) 2005, 2006 Xavier Santolaria <xsa@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
Line 1044 
Line 1046 
         return (ret);          return (ret);
 }  }
   
   /*
    * cvs_strsplit()
    *
    * Split a string <str> of <sep>-separated values and allocate
    * an argument vector for the values found.
    */
   char **
   cvs_strsplit(char *str, const char *sep)
   {
           char **argv, **nargv;
           char *cp, *p;
           int i = 0;
   
           cp = xstrdup(str);
           argv = (char **)xmalloc((i+1) * sizeof(char *));
   
           while ((p = strsep(&cp, sep)) != NULL) {
                   argv[i++] = p;
                   nargv = (char **)xrealloc((void *)argv, (i+1) * sizeof(char *));
                   argv = nargv;
           }
           argv[i] = NULL;
   
           return (argv);
   }

Legend:
Removed from v.1.70  
changed lines
  Added in v.1.71