]>
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.
13 m_backup (const char *file
)
16 static char buffer
[BUFSIZ
];
18 if ((cp
= r1bindex((char *) file
, '/')) == file
)
19 snprintf(buffer
, sizeof(buffer
), "%s%s",
22 snprintf(buffer
, sizeof(buffer
), "%.*s%s%s", (int)(cp
- file
), file
,
25 (void) m_unlink(buffer
);