📄 changelo.g
字号:
before dereferencing the argv vector.
Wed Jun 20 01:46:09 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* cat.c (cat): If FIONREAD is available, only use it if it is
supported by the filesystem that the file is on.
* ln.c (do_link): Take out code to give an error if source and
dest are the same file. The dubious usefulness of the special
case to prevent 'ln x x' from removing 'x' (ln -i can be used
instead) is not worth preventing 'ln x y' from failing the
second time in a row, and appears to contradict POSIX anyway.
Mon Jun 18 02:48:17 1990 David J. MacKenzie (djm at apple-gunkies)
* ls.c (print_file_name_and_frills,
length_of_file_name_and_frills, print_long_format):
Allow 6 digits for i-number, not 5.
Sun Jun 17 00:09:23 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* install.c (install_dir): Don't check whether "" or the root
directory exists (the former fails on some systems).
* system.h: Make inclusion of sys/file.h conditional on USG
and _POSIX_SOURCE, not DIRENT.
* chmod.c (change_dir_mode): Use xrealloc instead of free and
xmalloc in case malloc already left extra room.
(xrealloc): New function.
* rm.c (clear_directory): Prevent buffer overruns.
More efficient string handling. Don't skip rest of directory
if continuing after finding circular inode.
(xrealloc): New function.
Sat Jun 16 01:45:42 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* argmatch.c (invalid_arg): Change order in which the items
are printed.
* ls.c: Add +tabsize (-T) option.
Fri Jun 15 23:40:55 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* dd.c (scanargs): For ibs and obs, set C_HARDWAY.
(copy): Use different buffers only if C_HARDWAY, not if
blocksizes are the same, to ensure constant output block sizes.
Wed Jun 13 23:56:20 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* savedir.c: New file from code in chmod.c, modified to
prevent buffer overruns.
* chmod.c (change_dir_mode), cp.c (copy_dir), du.c
(count_entry): Use savedir.
Thu Jun 7 03:52:02 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* system.h (ST_BLKSIZE) [!STBLOCKS_MISSING]: If st_blksize is
0 (as on pipe reads on some systems), use BSIZE instead.
Define BSIZE as DEV_BSIZE if necessary.
* Makefile, system.h, fileblocks.c: Use STBLOCKS_MISSING to
control whether st_blksize and st_blocks are used.
* Makefile, system.h, backupfile.c: Use DIRENT to control
whether <dirent.h> is used.
Sun Jun 3 20:26:19 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* cat.c (main): Add a variable to control whether the check
for input file == output file is made, because no values of
st_dev and st_ino should be assumed to be available for this
purpose. Only do the check for regular files.
* tac.c: Use bcopy instead of memcpy.
Wed May 30 15:34:47 EDT 1990 Jay Fenlason (hack@ai.mit.edu)
* cut.c (main) Don't dereference 0 while parsing args.
Thu May 31 00:55:36 1990 David J. MacKenzie (djm at apple-gunkies)
* fileblocks.c: New file.
* du.c (blocks_to_kb): Replace with convert_blocks macro.
(main): Recognize new -k option.
(usage): Document it.
* ls.c (nblocks): Replace with convert_blocks macro.
* system.h (ST_BLKSIZE) [USG]: Use BSIZE from sys/param.h instead of
having the user define BLKSIZE.
(ST_NBLOCKS) [USG]: Use st_blocks from fileblocks.c.
* head.c: Use longs instead of ints for file offsets, for 16
bit machines.
* cat.c, chmod.c, cmp.c, cp.c, cp.h, create.c, dd.c, dirlib.c,
du.c, head.c, system.h, backupfile.c, ln.c, ls.c, install.c,
mkdir.c, mkfifo.c, modechange.c, mv.c, mv_dir.c, rm.c,
rmdir.c, tail.c, tac.c: Optionally use ANSI C and POSIX header files.
Wed May 23 00:40:39 1990 David J. MacKenzie (djm at apple-gunkies)
* argmatch.c: New file, taken from ls.c.
* getversion.c (get_version): Use argmatch, to allow
abbreviations. Default backup type is existing_numbered.
* mv.c (main), ln.c (main), cp.c (main): Only make backups if
-b (+backup) is given. If envar SIMPLE_BACKUP_SUFFIX is set,
use it as a default instead of `~'.
* mv.c (usage), ln.c (usage), cp-aux.c (usage): Update messages.
Tue May 22 00:56:51 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* install.c: New file (from ../bin-src).
* cmp.c: Change some ints to longs for 16 bit machines.
(bcmp_cnt): Make char-pointer counting slightly simpler.
* dd.c (copy): Don't count completely failed writes as partial
writes. Make buffers unsigned. If blocking or unblocking,
pad final partial buffer if necessary.
* getversion.c: New file.
* mv.c (main), cp.c (main), ln.c (main): Control backup types
with getenv ("VERSION_CONTROL") and +version-control or -V.
* cp.c (yesno), mv.c (yesno), ln.c (yesno): Stop reading if
EOF reached as well as at newline.
* backupfile.[ch]: Rename var `version_control' to `backup_type'.
Sat May 19 23:38:46 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* touch.c: Change some error messages. Include "getopt.h".
Sat May 19 00:16:50 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* mv.c (main), ln.c (main), cp.c (main): Revise
backup-creation options.
* mv.c (usage), ln.c (usage), cp-aux.c (usage): Revise messages.
* chmod.c (describe_change): Use mode_string instead of
filemodestring.
* cp.c (main): Recognize new options for making backups.
* cp.c (copy): Make backups if requested. Fix typo.
* cp-aux.c (usage): Update message.
* mv.c, cp.c: Remove code to conditionally use utimes instead
of utime, since the extra resolution of utimes was not being
used, the emulation overhead is probably insignificant,
and utime is a standard function.
* cp-hash.c: Fix up comments.
Fri May 18 23:06:23 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* mv.c (do_move): Only make backup if dest file exists.
Don't continue moving file if dest can't be backed up.
* ln.c (do_link): Don't try to unlink dest if it was backed up.
Don't continue moving file if dest can't be backed up.
* system.h: Make SIGTYPE default to void if not defined.
* modechange.[ch]: Rename struct and external functions to start
with 'mode_'.
* modechange.c (oatoi): Make static.
(mode_compile): Take an additional arg indicating which
symbolic operators should be affected by the umask.
* modechange.h: Add defines for mode_compile arg mask.
If __STDC__, use prototypes.
* chmod.c, mkdir.c, mkfifo.c, create.c: Account for above changes.
Tue May 15 16:17:34 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* dd.c (copy): Quit with nonzero status if final write fails.
Mon May 14 14:34:10 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* tac.c, regex.c, regex.h: New files.
* dd.c: Make translation tables unsigned.
(main): Give `input_file' and `output_file' nonzero values for
stdin and stdout.
(parse_conversion): Set new global vars 'space_character' and
'newline_character' to correct values when translating to EBCDIC
(either flavor).
(copy): Use 'space_character' and 'newline_character' instead
of hardcoded ASCII values. Ignore attempts to seek on output pipe,
socket, or fifo. If possible, seek instead of reading to skip
initial input records. Sync with `space_character' instead of
nulls, for POSIX.
* cp.c (copy_reg): Compare lseek values as longs, not ints.
Sat May 12 01:16:42 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* cp-hash (remember_created): Return error status instead of
fatal error.
* cp.c (copy): Change caller.
(do_copy, copy_reg): Return error status instead of fatal error.
* cat.c (main): Allow input file to be output file for devices
(ttys, etc.). Check whether input file is output file when
reading standard input. Print any error messages for standard
input.
* cmp.c (bcmp_cnt): Handle int comparisons correctly on 16 bit
machines as well as 32 bit ones.
* cmp.c, tail.c, ls.c, cp.c, du.c: Use longs instead of ints
for file offsets.
* Move rename emulation from mv.c to dirlib.c so other
programs can use it.
* mv.c, ln.c (main): Recognize new options for making backups.
* mv.c (do_move), ln.c (do_link): Make backups if requested.
* mv.c, ln.c (usage): Update message.
* backupfile.c, backupfile.h: New files.
* cp.h: Ifdef out decl of umask because of SunOS 4.1 (POSIX) conflict.
* Define all `main' functions as returning void.
Fri May 11 02:11:03 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* ln.c, mv.c, rm.c, rmdir.c, create.c, chmod.c: Change some
error messages.
* cmp.c: Fix some exit statuses for POSIX.
* du.c, cmp.c, cat.c, cp-aux.c (error): Function removed.
Change callers to use error.c version.
* cp.c (copy, do_copy, copy_dir): Return an error status.
* ls.c (error, fatal, perror_with_name): Functions removed.
Change callers to use error.c.
Tue May 8 03:41:42 1990 David J. MacKenzie (djm at abyss)
* tac.c: Use regular expressions as the record boundaries.
Give better error messages.
Reformat code and make it more readable.
(main): Use getopt_long to parse options.
(tac_stdin): Do not make a temporary file if standard input
is a file.
(tac_file): New function.
(tac): Take an open file desc as an arg.
(output): Rewrite to use its own efficient buffering.
(xmalloc, xrealloc, xwrite): New functions.
Sat May 5 23:46:48 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* ln.c (do_link): Don't allow trying to link a file to itself,
because the source file would be removed if they are the same
directory entry, and also for consistency with mv and cp.
Fri May 4 13:42:53 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* cp.c (copy_reg): Only write a null to the end of the file if
the end of the file was sparse.
* ls.c (print_name_with_quoting): Make the char to print
unsigned to prevent sign extension problems with -b.
Fri Apr 20 13:52:15 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* Version 1.2 released.
Wed Apr 18 14:36:15 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* Makefile: Use chsize for ftruncate on Xenix.
* cp.c (copy): Remove broken code that attempted to
substitute for ftruncate on systems missing it.
Mon Apr 16 13:58:01 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* cp-aux.c (usage): Fix mistake in message.
* Version 1.1 released.
Sat Apr 14 17:23:11 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* ls.c (main): Don't remove leading path from program_name.
(basename): Function removed.
(length_of_file_name_and_frills): Don't add 1 for type indicator
for block and character special files.
Thu Apr 12 19:50:15 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* Makefile: Suggest using -DBLKSIZE=512 instead of 1024 for USG.
* dd.c (copy): Print copying statistics when exiting because
of a read or seek error.
(interrupt_handler): New function.
(main): Trap SIGINT to run interrupt_handler, for POSIX.
Tue Apr 10 01:09:38 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* chmod.c (change_file_mode): Don't change the mode of
symbolic links.
Mon Apr 9 13:30:00 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* modechange.c (compile_mode): Return an error if an octal
number argument is too large.
Sun Apr 8 20:33:20 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* dd.c: Use `error' instead of `fatal' and `pfatal_with_name',
for greater control of the message format.
* head.c, tail.c: Use `error' instead of `fatal_perror' and
`nonfatal_perror'. Remove some unnecessary info from messages.
* chmod.c, create.c, ln.c, mkdir.c, mkfifo.c, mv.c, mv_dir.c,
rm.c, rmdir.c: Remove definition of `error'.
* error.c: New file created from code in mv.c.
* Makefile: Link the above programs with error.o.
* ln.c (do_link): Use eaccess_stat to determine writability.
* mv.c (do_move): Ditto.
* rm.c (remove_file): Ditto.
(remove_dir): Use eaccess_stat to determine readability and
searchability. Move initial interactive query here from
clear_directory.
* Makefile: Link ln, mv, and rm with eaccess.o.
Sat Apr 7 11:47:52 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* Makefile: Link cp with eaccess.o.
* eaccess.c: New file adapted from code in cp.c and cp-aux.c.
* cp.c (copy): Use eaccess_stat to determine writability.
Consider a file unwritable by root if it has no permissions.
(main): Remove groups initialization code.
* cp-aux.c (member): Function deleted.
* cp.c (copy): Temporarily change the mode of directories if
necessary to overwrite them when running recursively.
Consider a directory to be non-overwritable if it lacks write
permission as well as if it lacks execute permission.
* cat.c (main), cp.c (copy_reg): Don't check error from close,
because we know the arg is good and so it cannot fail.
* rm.c, mv.c, mv_dir.c, chmod.c, create.c, ln.c: Remove some
irrelevant or redundant information from error messages.
Fri Apr 6 15:20:45 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* cp.c (copy): Only change mode of regular files and directories;
others are already correct.
Thu Apr 5 04:31:56 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* dd.c: Remove the vars that are set by command line options
from a useless struct and give them more meaningful names.
Mon Apr 2 02:58:34 1990 David J. MacKenzie (djm at spike.ai.mit.edu)
* cp.c (main): Use NGROUPS from sys/param.h to determine
whether BSD multiple groups are supported and how large to
make the array.
* Makefile: Remove references to GETGROUPS_MISSING.
Sun Apr 1 18:53:57 1990 David J. MacKenzie (djm at spike.ai.mit.edu)
* cp.c (main): Always initialize group info.
Sat Mar 31 22:29:57 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* mkfifo.c, create.c, mv_dir.c: New files.
* Makefile: Add rules for them.
* mv.c [RENAME_MISSING] (rename): To rename directories, run
setuid root mv_dir program.
Tue Mar 20 14:28:25 1990 David J. MacKenzie (djm at pogo.ai.mit.edu)
* touch.c: Remove POSIX_COMPAT ifdef since there is no reason
to disable the GNU extensions.
(main): Set new global var `program_name'.
(error): Replace with more versatile version.
Global: Change calls to fprintf and error to use the new error.
(main): Initialize global variables. Don't bother making
temporary copy of arg to -d. Don't ignore any files named on
the command line if -i is given.
(usage): Don't take an arg. Use `program_name' instead of
hardcoded name.
(touch): In utime emulation for BSD, ftruncate the file to its
original size so empty files stay empty after being touched.
Sun Mar 18 01:02:39 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* ln.c (strip_trailing_slashes): New function.
(main, do_link): Call it.
* cp-aux.c (strip_trailing_slashes): New function.
* cp.c (do_copy): Call it.
* cp.h: Declare it.
* mv.c (strip_trailing_slashes): New function.
(main, movefile): Call it.
Sat Mar 17 21:45:35 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* cp-aux.c, cp.h: Rename user_confirm_overwriting to yesno and
don't have it print a prompt, so it can be used in several
places.
* cp.c (do_copy): Change an error message to resemble mv's.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -