Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!brl-adm!brl-smoke!smoke!lcc.jbrown@ucla-locus.arpa From: lcc.jbrown@ucla-locus.arpa (Jordan Brown) Newsgroups: net.unix Subject: strdup Message-ID: <3325@brl-smoke.ARPA> Date: Tue, 26-Aug-86 14:38:19 EDT Article-I.D.: brl-smok.3325 Posted: Tue Aug 26 14:38:19 1986 Date-Received: Wed, 27-Aug-86 20:54:07 EDT Sender: news@brl-smoke.ARPA Lines: 19 /* the following code is in the public domain. I have never seen */ /* the original UNIX code for this function. */ /* hjb 08/25/86 */ char * strdup(s) char *s; { char *p; extern char *malloc(); if(p=malloc(strlen(s)+1)) strcpy(p,s); return p; } I am not sure, but I think that strdup comes from MicroSoft, and is only present under XENIX and their MSDOS C compiler. It's a useful function, though, and everybody should have it.