Commit b28d2a3d authored by Andreas Gustafsson's avatar Andreas Gustafsson
Browse files

the established alternate spelling of 'template' is

'templet', not 'templat'
parent c9c5b254
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: file.h,v 1.12 2000/10/03 05:45:38 marka Exp $ */
/* $Id: file.h,v 1.13 2000/10/20 22:09:00 gson Exp $ */
#ifndef ISC_FILE_H
#define ISC_FILE_H 1
......@@ -172,19 +172,18 @@ isc_file_isabsolute(const char *filename);
*/
isc_result_t
isc_file_template(const char *path, const char *templat, char *buf,
size_t buflen);
isc_file_template(const char *path, const char *templet, char *buf,
size_t buflen);
/*
* Create a OS specific template using 'path' to define the directory
* 'templat' to describe the filename and store the result in 'buf'
* Create an OS specific template using 'path' to define the directory
* 'templet' to describe the filename and store the result in 'buf'
* such that path can be renamed to buf atomically.
*/
isc_result_t
isc_file_renameunique(const char *file, char *templet);
/*
* Rename 'file' using 'templet' as template for the new file name.
* Rename 'file' using 'templet' as a template for the new file name.
*/
/*
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: file.c,v 1.25 2000/10/19 01:10:24 bwelling Exp $ */
/* $Id: file.c,v 1.26 2000/10/20 22:09:01 gson Exp $ */
#include <config.h>
......@@ -121,30 +121,30 @@ isc_file_mktemplate(const char *path, char *buf, size_t buflen) {
}
isc_result_t
isc_file_template(const char *path, const char *templat, char *buf,
isc_file_template(const char *path, const char *templet, char *buf,
size_t buflen) {
char *s;
REQUIRE(buf != NULL);
s = strrchr(templat, '/');
s = strrchr(templet, '/');
if (s != NULL)
templat = s + 1;
templet = s + 1;
s = strrchr(path, '/');
if (s != NULL) {
if ((s - path + 1 + strlen(templat) + 1) > buflen)
if ((s - path + 1 + strlen(templet) + 1) > buflen)
return (ISC_R_NOSPACE);
strncpy(buf, path, s - path + 1);
buf[s - path + 1] = '\0';
strcat(buf, templat);
strcat(buf, templet);
} else {
if ((strlen(templat) + 1) > buflen)
if ((strlen(templet) + 1) > buflen)
return (ISC_R_NOSPACE);
strcpy(buf, templat);
strcpy(buf, templet);
}
return (ISC_R_SUCCESS);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment