diff options
author | Simon Rettberg | 2018-10-16 10:08:48 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-10-16 10:08:48 +0200 |
commit | d3a98cf6cbc3bd0b9efc570f58e8812c03931c18 (patch) | |
tree | cbddf8e50f35a9c6e878a5bfe3c6d625d99e12ba /utils/vms-strdup.c | |
download | xscreensaver-d3a98cf6cbc3bd0b9efc570f58e8812c03931c18.tar.gz xscreensaver-d3a98cf6cbc3bd0b9efc570f58e8812c03931c18.tar.xz xscreensaver-d3a98cf6cbc3bd0b9efc570f58e8812c03931c18.zip |
Original 5.40
Diffstat (limited to 'utils/vms-strdup.c')
-rw-r--r-- | utils/vms-strdup.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/utils/vms-strdup.c b/utils/vms-strdup.c new file mode 100644 index 0000000..1afc257 --- /dev/null +++ b/utils/vms-strdup.c @@ -0,0 +1,25 @@ +/* + * strdup.c + * + * Simple version of strdup for machines without it (ie DEC Ultrix 4.2) + * Apparently VMS only got strdup in 1995 (v5.2...) + * + * By David Chatterton + * 29 July 1993 + * + * You can do anything you like to this... :) + * I've stolen it from xpilot and added it to the xvmstuils MPJZ ;-) + */ + +#if (__VMS_VER < 70000000) +#include <stdlib.h> +#include <string.h> + +char* strdup (const char* s1) +{ + char* s2; + if (s2 = (char*)malloc(strlen(s1)+1)) + strcpy(s2,s1); + return s2; +} +#endif |