]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Import of code from heimdal
authorHeimdal Developers <heimdal-discuss@sics.se>
Tue, 23 Nov 2010 11:22:51 +0000 (11:22 +0000)
committerJeffrey Altman <jaltman@openafs.org>
Wed, 24 Nov 2010 05:32:00 +0000 (21:32 -0800)
This commit updates the code imported from heimdal to
bd78baf668eca011257f05fef8334e0967500456 (switch-from-svn-to-git-1696-gbd78baf)

New files are:
roken/strsep.c

Change-Id: I10c99e408db40f6bcdb0e2c243c3016cd2bf1faa
Reviewed-on: http://gerrit.openafs.org/3370
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
src/external/heimdal/roken/getopt.c
src/external/heimdal/roken/strsep.c [new file with mode: 0644]

index 942e5b4b588a7374c68781983808813bd9cc806c..653853543bad7ff89fbe46ab74873ba907043db1 100644 (file)
@@ -34,9 +34,6 @@ static char sccsid[] = "@(#)getopt.c  8.1 (Berkeley) 6/4/93";
 #ifndef __STDC__
 #define const
 #endif
-#include <config.h>
-#include "roken.h"
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/external/heimdal/roken/strsep.c b/src/external/heimdal/roken/strsep.c
new file mode 100644 (file)
index 0000000..76b447c
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 1997 Kungliga Tekniska Högskolan
+ * (Royal Institute of Technology, Stockholm, Sweden).
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the Institute nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <config.h>
+
+#include <string.h>
+
+#include "roken.h"
+
+#ifndef HAVE_STRSEP
+
+ROKEN_LIB_FUNCTION char * ROKEN_LIB_CALL
+strsep(char **str, const char *delim)
+{
+    char *save = *str;
+    if(*str == NULL)
+       return NULL;
+    *str = *str + strcspn(*str, delim);
+    if(**str == 0)
+       *str = NULL;
+    else{
+       **str = 0;
+       (*str)++;
+    }
+    return save;
+}
+
+#endif