Revision 12455,
455 bytes
checked in by danw, 26 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r12454,
which included commits to RCS files with non-trunk default branches.
|
Line | |
---|
1 | |
---|
2 | /* |
---|
3 | * m_backup.c -- construct a backup file |
---|
4 | * |
---|
5 | * $Id: m_backup.c,v 1.1.1.1 1999-02-07 18:14:09 danw Exp $ |
---|
6 | */ |
---|
7 | |
---|
8 | #include <h/mh.h> |
---|
9 | |
---|
10 | |
---|
11 | char * |
---|
12 | m_backup (char *file) |
---|
13 | { |
---|
14 | char *cp; |
---|
15 | static char buffer[BUFSIZ]; |
---|
16 | |
---|
17 | if ((cp = r1bindex(file, '/')) == file) |
---|
18 | snprintf(buffer, sizeof(buffer), "%s%s", |
---|
19 | BACKUP_PREFIX, cp); |
---|
20 | else |
---|
21 | snprintf(buffer, sizeof(buffer), "%.*s%s%s", cp - file, file, |
---|
22 | BACKUP_PREFIX, cp); |
---|
23 | |
---|
24 | unlink(buffer); |
---|
25 | return buffer; |
---|
26 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.