From 5834ddd6df659d9c9dc7333284fc86762dea061a Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 31 Dec 2014 21:23:37 -0600 Subject: 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. --- toys/posix/cp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/posix') diff --git a/toys/posix/cp.c b/toys/posix/cp.c index e83dabae..c1a438f9 100644 --- a/toys/posix/cp.c +++ b/toys/posix/cp.c @@ -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)) * -- cgit v1.2.3