Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146333127
D10921.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D10921.diff
View Options
Index: head/usr.bin/indent/indent.1
===================================================================
--- head/usr.bin/indent/indent.1
+++ head/usr.bin/indent/indent.1
@@ -30,7 +30,7 @@
.\" @(#)indent.1 8.1 (Berkeley) 7/1/93
.\" $FreeBSD$
.\"
-.Dd July 25, 2017
+.Dd August 7, 2017
.Dt INDENT 1
.Os
.Sh NAME
@@ -119,7 +119,10 @@
is named
.Sq Pa /blah/blah/file ,
the backup file is named
-.Sq Pa file.BAK .
+.Sq Pa file.BAK
+by default. The extension used for the backup file may be overridden using the
+.Ev SIMPLE_BACKUP_SUFFIX
+environment variable.
.Pp
If
.Ar output-file
Index: head/usr.bin/indent/indent.c
===================================================================
--- head/usr.bin/indent/indent.c
+++ head/usr.bin/indent/indent.c
@@ -71,6 +71,8 @@
* file */
const char *out_name = "Standard Output"; /* will always point to name
* of output file */
+const char *simple_backup_suffix = ".BAK"; /* Suffix to use for backup
+ * files */
char bakfile[MAXPATHLEN] = "";
int
@@ -99,8 +101,8 @@
int last_else = 0; /* true iff last keyword was an else */
const char *profile_name = NULL;
+ const char *envval = NULL;
-
/*-----------------------------------------------*\
| INITIALIZATION |
\*-----------------------------------------------*/
@@ -160,6 +162,10 @@
output = NULL;
tabs_to_var = 0;
+ envval = getenv("SIMPLE_BACKUP_SUFFIX");
+ if (envval)
+ simple_backup_suffix = envval;
+
/*--------------------------------------------------*\
| COMMAND LINE SCAN |
\*--------------------------------------------------*/
@@ -1234,7 +1240,7 @@
p--;
if (*p == '/')
p++;
- sprintf(bakfile, "%s.BAK", p);
+ sprintf(bakfile, "%s%s", p, simple_backup_suffix);
/* copy in_name to backup file */
bakchn = creat(bakfile, 0600);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 2, 8:17 PM (7 h, 48 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29168780
Default Alt Text
D10921.diff (1 KB)
Attached To
Mode
D10921: indent(1): respect SIMPLE_BACKUP_SUFFIX environment variable
Attached
Detach File
Event Timeline
Log In to Comment