changeset 1633:556d8cbfeb08 draft

When CP_MORE was disabled, the d flag was still in the [-exclusion] list at the end and option parsing fell off the end looking for it (segfault) if DEBUG wasn't enabled to check for that.
author Rob Landley <rob@landley.net>
date Wed, 31 Dec 2014 21:23:37 -0600
parents aafd2f28245a
children 5fac2769a159
files toys/posix/cp.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/toys/posix/cp.c	Wed Dec 31 16:22:31 2014 -0600
+++ b/toys/posix/cp.c	Wed Dec 31 21:23:37 2014 -0600
@@ -7,7 +7,7 @@
 // This is subtle: MV options shared with CP must be in same order (right to
 // left) as CP for FLAG_X macros to work out right.
 
-USE_CP(NEWTOY(cp, "<2RHLPp"USE_CP_MORE("rdaslvnF")"fi[-HLPd]"USE_CP_MORE("[-ni]"), TOYFLAG_BIN))
+USE_CP(NEWTOY(cp, "<2RHLPp"USE_CP_MORE("rdaslvnF")"fi[-HLP"USE_CP_MORE("d")"]"USE_CP_MORE("[-ni]"), TOYFLAG_BIN))
 USE_MV(NEWTOY(mv, "<2"USE_CP_MORE("vnF")"fi"USE_CP_MORE("[-ni]"), TOYFLAG_BIN))
 USE_INSTALL(NEWTOY(install, "<1cdDpsvm:o:g:", TOYFLAG_USR|TOYFLAG_BIN))
 *