mirror of
https://github.com/opnsense/src.git
synced 2026-05-04 17:05:14 -04:00
Make ls recognize the COLUMNS environmental variable, even
in cases where it does not run on a terminal. This is important e.g. for commands like env COLUMNS=132 ls -CR | lpr -Psome-wide-printer
This commit is contained in:
parent
d9a2713bb5
commit
34994fcd8e
1 changed files with 6 additions and 2 deletions
|
|
@ -33,7 +33,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: ls.c,v 1.3 1994/09/24 02:55:54 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
|
|
@ -114,8 +114,12 @@ main(argc, argv)
|
|||
else
|
||||
termwidth = win.ws_col;
|
||||
f_column = f_nonprint = 1;
|
||||
} else
|
||||
} else {
|
||||
f_singlecol = 1;
|
||||
/* retrieve environment variable, in case of explicit -C */
|
||||
if (p = getenv("COLUMNS"))
|
||||
termwidth = atoi(p);
|
||||
}
|
||||
|
||||
/* Root is -A automatically. */
|
||||
if (!getuid())
|
||||
|
|
|
|||
Loading…
Reference in a new issue