Commit Graph

43 Commits

Author SHA1 Message Date
lukem ba2e04dc88 convert to new KNF 2000-07-29 03:46:14 +00:00
assar c5a806697b Do not modify the file name when not printing non-printables, also do
it consistently with the file name and possible symbolic link target.

fixes bin/10385 and bin/10384
2000-06-17 16:11:25 +00:00
enami c3a9dd2e8d - Fix a typo that when group_from_gid is failed (though it merely fails
on NetBSD), numeric gid string is used as `user'.
- Don't mix use %u and %d for numeric uid/gid.
- Share temporary buffer.
2000-03-06 11:03:45 +00:00
drochner 85cbf55d16 Since our gcc doesn't warn about NULL format strings anymore, we can
fix the incorrect err(1, "%s", "") et al.
Closes PR bin/7592 by cgd.
1999-11-09 15:06:30 +00:00
tron c87c6d5c86 Call setlocale(3) to use localization in "ls" as suggested by
Jens A Nilsson in PR bin/8730.
1999-11-02 19:44:07 +00:00
lukem 37085e7c0d Rename ls.c::main() -> ls.c::ls_main(), and add a wrapper in main.c::main().
This allows other programs to link in against ls (e.g, ftpd), without having
to have hacks to deal with multiple main()s.

Yes, I know this is ugly. The clean alternative (move lots of this
into libutil, yada yada yada) isn't fun, and the effort probably isn't
justified...
1999-05-17 12:16:03 +00:00
simonb a4b250cd02 If an error is encountered, exit with non-zero status.
Based on FreeBSD fix (in 1996!), and fixes PR bin/7514 from
Jorgen Pehrson.
1999-05-04 11:55:22 +00:00
kleink b424b8fe8c Add support for the XCU5 -p option (-F restricted to directories). 1999-02-17 15:28:08 +00:00
kleink b7443b0f16 Implement 1003.2 -m option (stream output format). 1999-02-12 14:35:48 +00:00
christos a7e8a30ca7 %q -> %ll 1998-11-04 18:53:17 +00:00
christos 7f10b1cf33 include termios.h for struct winsize 1998-11-04 18:50:22 +00:00
wsanchez 0a8ce08607 Check for NULL value returned by user_from_uid and group_from_gid and DTRT,
rather than crash.
1998-10-13 16:55:22 +00:00
thorpej 45e5a86960 Add some braces to make egcs happy. 1998-08-19 01:43:22 +00:00
mycroft 9dc385beb1 Delint. 1998-07-28 05:31:22 +00:00
mycroft 1381f68431 Delint. 1998-07-28 05:15:46 +00:00
mycroft ac70c0c5ed Slight code reduction. 1998-07-27 17:55:17 +00:00
mycroft 0e2f9ea923 __AUDIT__ cleanup. 1998-07-27 17:06:48 +00:00
lukem e30b76288b * blocks can be 64bit (not u_long), so calculate and display accordingly
* cleanup some other typedamage (int is as good as u_long)
* remove unused variables
1998-05-16 15:12:26 +00:00
mycroft 1ee799896c Deal with GCC warning. 1998-02-03 02:02:13 +00:00
lukem ac591fc02c * implement -x; sort columns across the page rather than down the page
* in printcol(), don't bother building an index to the linked list if
  only printing one column with printscol()...
* implement -n; prevent [gu]id->name mapping in long listings.
  inspired by openbsd, but does *not* imply -l by itself.
* fix sorting with -d (or mismatched types in general).  (from openbsd).
* document -g. (from openbsd).
1998-01-18 13:30:03 +00:00
mycroft 9ded7f638d Automatically resize the major and minor number fields, and DTRT if the size
field is not the same size.
1998-01-17 12:00:42 +00:00
thorpej f566fe5da3 Add some casts to printf args to keep the compiler happy on the Alpha. 1997-07-30 05:01:01 +00:00
christos d91f759e44 include <pwd.h> and <grp.h> to bring prototypes into scope. 1997-07-20 19:20:01 +00:00
christos f5b66975d0 remove user_from_uid and group_from_gid prototypes. 1997-07-20 19:07:05 +00:00
christos b22592e84f Fix compiler warnings.
Add WARNS=1
1997-07-20 18:52:57 +00:00
mycroft 00e5d89a69 Sort FTS_NS entries by name, just so the order is well-defined. 1996-07-09 09:16:29 +00:00
mycroft c603307d33 Partition FTS_NS entries from others, to avoid confusing qsort().
Don't bother to order the FTS_NS entries amongst themselves.
1996-07-08 10:20:16 +00:00
jtc 645e4d83ee Changed so that COLUMNS environment variable will override the value
obtained via the TIOCGWINSIZ ioctl.  This is required by POSIX.2, see
section 4.39.5.3.
1996-02-14 05:58:53 +00:00
jtc d943cdadce Sync with 4.4lite2 1995-09-07 06:42:58 +00:00
cgd 49f0ad8601 convert to new RCS id conventions. 1995-03-21 09:01:59 +00:00
mycroft d966913f57 Sync with CSRG. 1994-12-27 23:14:46 +00:00
mycroft 83ede345fb Merge with 4.4-Lite version. 1994-09-23 06:14:39 +00:00
jtc 32a561a5d1 Changed traverse() and display() so that errors are reported when
they are first detected in display(), rather than waiting until later
in traverse().

The old code allowed "Can not read directory" error messages to be
left unreported unless the -R (recurse) option was used.
1994-04-08 02:06:45 +00:00
chopps 854720238b "yet" on quad_t/off_t things. (not noticed on i386 becuase of endian I guess.) 1994-04-04 19:29:42 +00:00
cgd 006b4ddd7f (1) fixup getbsize() calls
(2) convert to use err(), warn(), and warnx(), as appropriate.
1994-01-25 20:44:48 +00:00
mycroft f6a07377e5 Patches from Thomas Eberhardt <thomas@mathematik.uni-Bremen.de> to allow
sorting by size.
1993-12-05 21:35:20 +00:00
mycroft 203e422702 New version from uunet, with -k option readded, and 4.4 ffs--specific stuff
in `#ifdef notyet'.
1993-08-07 03:56:47 +00:00
mycroft 8542364e07 Add RCS identifiers. 1993-08-01 18:49:50 +00:00
deraadt 3d45ba4b4c previous patch to ls.c wasn't quite correct. This patch from same author. 1993-05-26 10:23:24 +00:00
deraadt 2aa7b66ed6 first environment variable was trounced in the case of
"ls -l". Patch from <bob@obiwan.uucp> Bob Willcox
1993-05-24 07:15:03 +00:00
cgd 06be60083d changed "Id" to "Header" for rcsids 1993-03-23 00:22:59 +00:00
cgd 346aa5dd48 added rcs ids to all files 1993-03-22 08:04:00 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00