-const char list_rcs[] = "$Id: list.c,v 1.3 2001/06/03 19:12:24 oes Exp $";
+const char list_rcs[] = "$Id: list.c,v 1.5 2001/06/29 21:45:41 oes Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/list.c,v $
*
* Revisions :
* $Log: list.c,v $
+ * Revision 1.5 2001/06/29 21:45:41 oes
+ * Indentation, CRLF->LF, Tab-> Space
+ *
+ * Revision 1.4 2001/06/29 13:30:22 oes
+ * - Added Convenience function enlist_unique_header(),
+ * which takes the Header name and value as separate
+ * arguments and thus saves the pain of sprintf()ing
+ * and determining the Header name length to enlist_unique
+ * - Improved comments
+ * - Removed logentry from cancelled commit
+ *
* Revision 1.3 2001/06/03 19:12:24 oes
* functions for new struct map, extended enlist_unique
*
if (name == NULL || value == NULL) return;
dummy = strdup(name);
- dummy = strsav(dummy, ": ");
+ dummy = strsav(dummy, ": ");
length = strlen(dummy);
while (cur != NULL)
{
if ((cur->str != NULL) &&
- (0 == strncmp(dummy, cur->str, length)))
+ (0 == strncmp(dummy, cur->str, length)))
{
/* Already there */
return;
if (cur != NULL)
{
- cur->str = strsav(dummy, value);
+ cur->str = strsav(dummy, value);
cur->next = NULL;
last = header->last;
*
* Function : list_to_text
*
- * Description : "Flaten" a string list into 1 long \r\n delimited string.
+ * Description : "Flaten" a string list into 1 long \r\n delimited string,
+ * adding an empty line at the end.
*
* Parameters :
* 1 : h = pointer to list 'dummy' header
struct list *p;
char *ret = NULL;
char *s;
- int size;
-
- size = 0;
+ int size = 2;
for (p = h->next; p ; p = p->next)
{
*s++ = '\r'; *s++ = '\n';
}
}
+ *s++ = '\r'; *s++ = '\n';
return(ret);
p = p->next;
}
return "";
+
}