]>
diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/sbr/m_scratch.c
1 /* m_scratch.c - construct a scratch file */
7 char *m_scratch (file
, template)
12 static char buffer
[BUFSIZ
],
15 (void) sprintf (tmpfil
, "%sXXXXXX", template);
16 (void) mktemp (tmpfil
);
17 if ((cp
= r1bindex (file
, '/')) == file
)
18 (void) strcpy (buffer
, tmpfil
);
20 (void) sprintf (buffer
, "%.*s%s", cp
- file
, file
, tmpfil
);
21 (void) unlink (buffer
);