]>
diplodocus.org Git - nmh/blob - sbr/m_backup.c
1 /* m_backup.c -- construct a backup file
3 * This code is Copyright (c) 2002, by the authors of nmh. See the
4 * COPYRIGHT file in the root directory of the nmh distribution for
5 * complete copyright information.
12 m_backup (const char *file
)
15 static char buffer
[BUFSIZ
];
17 if ((cp
= r1bindex((char *) file
, '/')) == file
)
18 snprintf(buffer
, sizeof(buffer
), "%s%s",
21 snprintf(buffer
, sizeof(buffer
), "%.*s%s%s", (int)(cp
- file
), file
,
24 (void) m_unlink(buffer
);