+2016-11-02 Pádraig Brady <P@draigBrady.com>
+
+ backupfile: initialize default suffix within the implementation
+ * lib/backupfile.c (find_backup_file_name): Initialize the
+ global variable here, to simplify usage, and to only call
+ getenv() when needed.
+
2016-11-01 Paul Eggert <eggert@cs.ucla.edu>
futimens: remove FIXME for old Linux kernels
/* The extension added to file names to produce a simple (as opposed
to numbered) backup file name. */
-char const *simple_backup_suffix = "~";
+char const *simple_backup_suffix = NULL;
/* If FILE (which was of length FILELEN before an extension was
size_t ssize;
bool simple = true;
+ /* Initialize the default simple backup suffix. */
+ if (! simple_backup_suffix)
+ {
+ char const *env_suffix = getenv ("SIMPLE_BACKUP_SUFFIX");
+ if (env_suffix && *env_suffix)
+ simple_backup_suffix = env_suffix;
+ else
+ simple_backup_suffix = "~";
+ }
+
/* Allow room for simple or ".~N~" backups. The guess must be at
least sizeof ".~1~", but otherwise will be adjusted as needed. */
size_t simple_backup_suffix_size = strlen (simple_backup_suffix) + 1;