Page MenuHomeFreeBSD

indent(1): respect SIMPLE_BACKUP_SUFFIX environment variable
ClosedPublic

Authored by kevans on May 26 2017, 4:18 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 15, 1:13 AM
Unknown Object (File)
Sat, Oct 4, 6:34 AM
Unknown Object (File)
Thu, Oct 2, 4:16 PM
Unknown Object (File)
Sep 5 2025, 2:23 PM
Unknown Object (File)
Sep 4 2025, 11:21 PM
Unknown Object (File)
Aug 8 2025, 8:15 PM
Unknown Object (File)
Jul 27 2025, 2:52 AM
Unknown Object (File)
Jul 11 2025, 11:32 AM
Subscribers

Details

Summary

Address a personal nit: indent(1) defaults to using ".BAK" as the suffix
for backup files. This is the most inconvenient part of some of my workflow, so
allow it to be made consistent with the SIMPLE_BACKUP_SUFFIX environment variable.

Test Plan

Ensure tests still pass and that the default suffix remains ".BAK" and
that it can be overridden properly.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 9510
Build 9959: arc lint + arc unit

Event Timeline

I assume this matches some existing convention (re: name of the environment variable)?

This revision is now accepted and ready to land.May 26 2017, 4:11 PM

Indeed, the name of the env variable follows convention established by GNU indent(1) and, perhaps more importantly, our patch(1) also uses it if specified unless overridden by a flag.

pstef added a subscriber: pstef.
pstef added inline comments.
usr.bin/indent/indent.c
104

I'd suggest const char *envval = NULL;

kevans edited edge metadata.
  • Const'ify envval based on suggestion by pstef@
This revision now requires review to proceed.May 26 2017, 6:52 PM
This revision is now accepted and ready to land.May 26 2017, 6:59 PM
This revision was automatically updated to reflect the committed changes.