aboutsummaryrefslogtreecommitdiffstats
path: root/lib/backupfile.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2006-08-21Remove from CVS, since the bootstrap script generates them automatically.Paul Eggert1-361/+0
2006-07-11Sync from gnulib.Paul Eggert1-9/+4
2006-07-09Update from gnulib.Paul Eggert1-24/+5
2006-03-26(check_extension, numbered_backup): s/base_name/last_component/Jim Meyering1-3/+4
2005-09-22Sync from gnulib.Paul Eggert1-1/+1
2005-09-13Use ARGMATCH_VERIFY, just in case.Jim Meyering1-1/+5
2005-07-02Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.Jim Meyering1-3/+1
2005-06-23(backup_args): Change a `0' to NULL.Jim Meyering1-2/+2
2005-05-14Update FSF postal mail address.Jim Meyering1-1/+1
2004-09-22Remove trailing blank.Jim Meyering1-1/+1
2004-09-13(check_extension, numbered_backup):Paul Eggert1-31/+31
Rename locals to avoid shadowing 'basename'.
2004-07-27backupfile.c rewrite to avoid arbitrary limits on lengths ofPaul Eggert1-115/+243
numeric backup extensions. Include "backupfile.h" first. Include errno.h, stdbool.h, limits.h, unistd.h, xalloc.h. (CLOSEDIR, INT_STRLEN_BOUND): Remove. (pathconf) [! (HAVE_PATHCONF && defined _PC_NAME_MAX)]: New macro. (_POSIX_NAME_MAX) [!defined _POSIX_NAME_MAX]: New macro. (NAME_MAX_MAXIMUM): New macro. Unlike the old addext.c, we also look at _XOPEN_NAME_MAX, for better performance on modern hosts that support only file names of length 255 or more. (ISDIGIT): unsigned -> unsigned int (max_backup_version, version_number): Remove. (check_extension): New function. Similar to the old addext, but static, assumes that the extension has already been added, and a bit more careful on DOS hosts. (numbered_backup): New function. It does what max_backup_version and version_number used to do, but it doesn't use integer arithmetic to calculate extensions so it doesn't overflow. (find_backup_file_name): Rewrite to use these new functions. This has a new optimization: we needn't call pathconf if the new numbered backup name has the same length as the old. Also, use xmalloc rather than malloc, so that the caller needn't worry about memory exhaustion.
2004-06-30(FILE_SYSTEM_PREFIX_LEN): Renamed fromJim Meyering1-2/+2
FILESYSTEM_PREFIX_LEN. All uses changed.
2003-09-10Include <string.h>, <stdlib.h> unconditionally.Jim Meyering1-22/+2
Don't declare getenv or malloc.
2003-06-18(PARAMS): Remove. All uses removed.Jim Meyering1-2/+2
2003-06-06Update from gnulib.Jim Meyering1-9/+6
2002-01-16(ISDIGIT): Comment fix.Jim Meyering1-5/+4
add 2002 to Copyright line
2001-05-12Use "", not <> to include non-system header files.Jim Meyering1-3/+3
2001-05-12(base_name): Remove; now in dirname.h.Jim Meyering1-14/+16
Include <dirname.h> after size_t is defined. (find_backup_file_name, max_backup_version): Use base_len instead of rolling it ourselves. Handle the case of "" and (on DOS) "C:" correctly.
2000-02-27Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H', not `#if STDC_HEADERS'.Jim Meyering1-3/+8
Declare malloc if needed.
2000-02-27use double quotes, not single quotes around syntax-error-evoking stringJim Meyering1-1/+1
2000-02-27Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'Jim Meyering1-1/+4
now that autoconf always defines the HAVE_DECL_ symbols. Arrange for cpp to fail if the configure-time declaration check was not run.
1999-01-16[!HAVE_DECL_GETENV]: Declare getenv.Jim Meyering1-10/+40
(backup_args): Reorder enum members. (backup_types): Likewise. (get_version): Take an additional parameter, `context'. (xget_version): Like get_version, but if the `version' argument is NULL, use the value of the envvar VERSION_CONTROL. (base_name): Declare.
1999-01-02(get_version): Adapt to use new interface to XARGMATCH.Jim Meyering1-4/+7
1999-01-01(get_version): Use XARGCASEMATCH in place of argmatch & co.Jim Meyering1-9/+2
1998-11-14revert-to-4.0-b7Jim Meyering1-14/+2
1998-11-14revert-last-changeJim Meyering1-1/+5
1998-11-11back out last change: there is a better wayJim Meyering1-5/+1
1998-11-11(BACKUPFILE_EXIT_FAILURE): Define.Jim Meyering1-1/+5
(get_version): Use it in place of EXIT_FAILURE.
1998-11-10[EXIT_FAILURE]: Define.Jim Meyering1-2/+10
(get_version): Use EXIT_FAILURE as exit status rather than hard-coding `2'. From François Pinard.
1998-01-21Fix copyrightJim Meyering1-1/+1
1998-01-21Use ANSI function definitions.Jim Meyering1-7/+4
Remove global declaration of backup_type. (simple_backup_suffix): Default to `~', not `.orig'. Use PARAMS, not __BACKUPFILE_P. (find_backup_file_name): Add parameter, backup_type.
1998-01-20Use ANSI function definitions.Jim Meyering1-13/+6
1997-05-27Update from FSF via patch-2.2.93.Jim Meyering1-91/+115
1997-02-04libitizeJim Meyering1-43/+34
1996-12-18(ISDIGIT): Replace with smaller, faster editionJim Meyering1-2/+11
that yields nonzero only on ASCII digits. (ISDIGIT_LOCALE): New macro, with same meaning that ISDIGIT used to have. From Paul Eggert.
1996-07-15update FSF address in copyrightJim Meyering1-2/+2
1996-05-05[IN_CTYPE_DOMAIN]: Rename from ISASCII.Jim Meyering1-3/+3
1996-04-24(find_backup_file_name, max_backup_version, make_version_name,Jim Meyering1-7/+9
version_number, concat): Constify decls of formal parameters.
1996-03-12(max_backup_version): Declare file_name_length to be of type size_t.Jim Meyering1-1/+1
1995-08-09Indent cpp directives.Jim Meyering1-23/+23
1995-05-13Remove unnecessary definitions for r?index.Jim Meyering1-11/+6
Update definitions for ISDIGIT.
1994-10-02merge with 3.9hJim Meyering1-7/+0
1994-10-02.Jim Meyering1-10/+10
1994-07-30.Jim Meyering1-3/+3
1993-10-12merge with 3.8.4cJim Meyering1-2/+2
1993-10-09merge with 3.8.3eJim Meyering1-4/+4
1993-10-06merge with 3.8.3bFILEUTILS-3_8_3bJim Meyering1-0/+11
1993-07-24merge with 3.8Jim Meyering1-1/+1
1993-04-22merge with 3.5Jim Meyering1-0/+4