/************************************************************************/ /* */ /* Create pathname of a temporary file */ /* */ /* Bug reports should be sent to */ /* */ /* harald@os2point.ping.de */ /* harald@haport.sesam.com */ /* Fido: 2:2448/434 */ /* */ /************************************************************************/ #include #include #include #include #include char *maketemp(char *pathname, const char *template) { register char *cp1; register char *cp = pathname; if((cp1 = getenv("TMP")) != NULL) { while(*cp1) { if(*cp1 == '/') { *cp++ = '\\'; cp1++; } else *cp++ = *cp1++; } if(*(cp - 1) != '\\') *cp++ = '\\'; } mktemp(strcpy(cp, template)); return(pathname); }