From: Jim Meyering Date: Thu, 22 Jan 1998 08:19:17 +0000 (+0000) Subject: [NDEBUG]: Comment out definition. X-Git-Tag: FILEUTILS-3_16l~47 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6cce6a1b7f4905a975270b6ac257ea20b276ddae;p=platform%2Fupstream%2Fcoreutils.git [NDEBUG]: Comment out definition. (do_copy): Use x->backup_type, not the global. --- diff --git a/src/cp.c b/src/cp.c index a2814c2..57b9d17 100644 --- a/src/cp.c +++ b/src/cp.c @@ -25,7 +25,9 @@ #include #include +/* FIXME: uncomment for release #define NDEBUG +*/ #include #include @@ -521,17 +523,22 @@ do_copy (int argc, char **argv, const struct cp_options *x) where SUFFIX is determined by any version control options used. */ if (x->force - && backup_type != none + && x->backup_type != none && STREQ (source, dest) && !new_dst && S_ISREG (sb.st_mode)) { - new_dest = find_backup_file_name (dest); - /* Set backup_type to `none' so that the normal backup + static struct cp_options x_tmp; + + new_dest = find_backup_file_name (dest, x->backup_type); + /* Set x->backup_type to `none' so that the normal backup mechanism is not used when performing the actual copy. backup_type must be set to `none' only *after* the above call to find_backup_file_name -- that function uses backup_type to determine the suffix it applies. */ - backup_type = none; + x_tmp = *x; + x_tmp.backup_type = none; + x = &x_tmp; + if (new_dest == NULL) error (1, 0, _("virtual memory exhausted")); } @@ -743,8 +750,7 @@ main (int argc, char **argv) usage (1); } - if (make_backups) - backup_type = get_version (version); + x.backup_type = (make_backups ? get_version (version) : none); if (x.preserve == 1) x.umask_kill = 0777777;