master
Add native support for ed-style diffs. No need to pledge "proc exec" anymore.
add "-V none" to prevent making any backups
More cleanup: sprinkled some const, removed ugly EXTERN/INTERN.h, some rewriting of code to make it more readable and more KNF.
Use getline(3) to handle lines longer than 8192 bytes in patch files
When system calls indicate an error they return -1, not some arbitrary value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
Add license from patch.c to original source files missing a license.
Use errc/warnc to simplify code. Also, in 'ftp', always put the error message last, after the hostname/ipaddr.
use strtonum() to parse numeric option values instead of atoi()
Don't run off the end of path if it ends in /. OK op, sthen
Use ssize_t instead of short for line lengths
For open/openat, if the flags parameter does not contain O_CREAT, the 3rd (variadic) mode_t parameter is irrelevant. Many developers in the past have passed mode_t (0, 044, 0644, or such), which might lead future people to copy this broken idiom, and perhaps even believe this parameter has some meaning or implication or application. Delete them all. This comes out of a conversation where tb@ noticed that a strange (but intentional) pledge behaviour is to always knock-out high-bits from mode_t on a number of system calls as a safety factor, and his bewilderment that this appeared to be happening against valid modes (at least visually), but no sorry, they are all irrelevant junk. They could all be 0xdeafbeef. ok millert
signal handlers should not call exit() due to possibility of reentering libc (stdio etc), instead do the unlink tasks then call _exit() instead ok millert