aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cp_mv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cp_mv.c b/cp_mv.c
index 5e1a8415e..f56c6dd49 100644
--- a/cp_mv.c
+++ b/cp_mv.c
@@ -214,6 +214,10 @@ extern int cp_mv_main(int argc, char **argv)
usage(cp_mv_usage[dz_i]);
}
} else { /* (dz_i == is_mv) */
+ /* Initialize optind to 1, since in libc5 optind
+ * is not initialized until getopt() is called
+ * (or until sneaky programmers force it...). */
+ optind = 1;
recursiveFlag = preserveFlag = TRUE;
followLinks = FALSE;
}