Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
Erik Andersen | fac10d7 | 2000-02-07 05:29:42 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Mini `cp' and `mv' implementation for BusyBox. |
| 4 | * |
| 5 | * |
| 6 | * Copyright (C) 1999 by Lineo, inc. |
| 7 | * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> |
| 8 | * |
| 9 | * Copyright (C) 2000 by BitterSweet Enterprises, LLC. (GPL) |
| 10 | * Extensively modified and rewritten by Karl M. Hegbloom <karlheg@debian.org> |
| 11 | * |
| 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by |
| 14 | * the Free Software Foundation; either version 2 of the License, or |
| 15 | * (at your option) any later version. |
| 16 | * |
| 17 | * This program is distributed in the hope that it will be useful, |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 20 | * General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU General Public License |
| 23 | * along with this program; if not, write to the Free Software |
| 24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 25 | * |
| 26 | */ |
| 27 | |
Eric Andersen | 3570a34 | 2000-09-25 21:45:58 +0000 | [diff] [blame] | 28 | #include "busybox.h" |
Erik Andersen | fac10d7 | 2000-02-07 05:29:42 +0000 | [diff] [blame] | 29 | #define BB_DECLARE_EXTERN |
| 30 | #define bb_need_name_too_long |
| 31 | #define bb_need_omitting_directory |
| 32 | #define bb_need_not_a_directory |
| 33 | #include "messages.c" |
| 34 | |
| 35 | #include <stdio.h> |
| 36 | #include <time.h> |
| 37 | #include <utime.h> |
| 38 | #include <dirent.h> |
| 39 | #include <sys/param.h> |
Erik Andersen | 61677fe | 2000-04-13 01:18:56 +0000 | [diff] [blame] | 40 | #include <setjmp.h> |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 41 | #include <string.h> |
| 42 | #include <unistd.h> |
| 43 | #include <errno.h> |
Eric Andersen | f4c0226 | 2000-07-13 18:42:58 +0000 | [diff] [blame] | 44 | #include <getopt.h> |
Erik Andersen | fac10d7 | 2000-02-07 05:29:42 +0000 | [diff] [blame] | 45 | |
| 46 | #define is_cp 0 |
| 47 | #define is_mv 1 |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 48 | static int dz_i; /* index into cp_mv_usage */ |
Matt Kraai | 3bd8bd8 | 2000-07-14 23:28:47 +0000 | [diff] [blame] | 49 | |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 50 | static const char *cp_mv_usage[] = /* .rodata */ |
Erik Andersen | fac10d7 | 2000-02-07 05:29:42 +0000 | [diff] [blame] | 51 | { |
Matt Kraai | 3bd8bd8 | 2000-07-14 23:28:47 +0000 | [diff] [blame] | 52 | cp_usage, |
| 53 | mv_usage |
Erik Andersen | fac10d7 | 2000-02-07 05:29:42 +0000 | [diff] [blame] | 54 | }; |
| 55 | |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 56 | static int recursiveFlag; |
| 57 | static int followLinks; |
| 58 | static int preserveFlag; |
Erik Andersen | 59b9e87 | 2000-05-10 05:05:45 +0000 | [diff] [blame] | 59 | static int forceFlag; |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 60 | |
| 61 | static const char *baseSrcName; |
| 62 | static int srcDirFlag; |
| 63 | static struct stat srcStatBuf; |
| 64 | |
Erik Andersen | 4f3f757 | 2000-04-28 00:18:56 +0000 | [diff] [blame] | 65 | static char baseDestName[BUFSIZ + 1]; |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 66 | static size_t baseDestLen; |
| 67 | static int destDirFlag; |
| 68 | static struct stat destStatBuf; |
| 69 | |
| 70 | static jmp_buf catch; |
| 71 | static volatile int mv_Action_first_time; |
| 72 | |
| 73 | static void name_too_long__exit (void) __attribute__((noreturn)); |
| 74 | |
| 75 | static |
| 76 | void name_too_long__exit (void) |
| 77 | { |
Mark Whitley | f57c944 | 2000-12-07 19:56:48 +0000 | [diff] [blame] | 78 | error_msg_and_die(name_too_long); |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | static void |
| 82 | fill_baseDest_buf(char *_buf, size_t * _buflen) { |
| 83 | const char *srcBasename; |
| 84 | if ((srcBasename = strrchr(baseSrcName, '/')) == NULL) { |
| 85 | srcBasename = baseSrcName; |
| 86 | if (_buf[*_buflen - 1] != '/') { |
Erik Andersen | 4f3f757 | 2000-04-28 00:18:56 +0000 | [diff] [blame] | 87 | if (++(*_buflen) > BUFSIZ) |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 88 | name_too_long__exit(); |
| 89 | strcat(_buf, "/"); |
| 90 | } |
| 91 | } |
Erik Andersen | 4f3f757 | 2000-04-28 00:18:56 +0000 | [diff] [blame] | 92 | if (*_buflen + strlen(srcBasename) > BUFSIZ) |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 93 | name_too_long__exit(); |
| 94 | strcat(_buf, srcBasename); |
| 95 | return; |
| 96 | |
| 97 | } |
| 98 | |
| 99 | static int |
Erik Andersen | 3364d78 | 2000-03-28 00:58:14 +0000 | [diff] [blame] | 100 | cp_mv_Action(const char *fileName, struct stat *statbuf, void* junk) |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 101 | { |
Erik Andersen | 4f3f757 | 2000-04-28 00:18:56 +0000 | [diff] [blame] | 102 | char destName[BUFSIZ + 1]; |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 103 | size_t destLen; |
| 104 | const char *srcBasename; |
| 105 | char *name; |
| 106 | |
| 107 | strcpy(destName, baseDestName); |
| 108 | destLen = strlen(destName); |
| 109 | |
| 110 | if (srcDirFlag == TRUE) { |
| 111 | if (recursiveFlag == FALSE) { |
Mark Whitley | f57c944 | 2000-12-07 19:56:48 +0000 | [diff] [blame] | 112 | error_msg(omitting_directory, baseSrcName); |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 113 | return TRUE; |
| 114 | } |
| 115 | srcBasename = (strstr(fileName, baseSrcName) |
| 116 | + strlen(baseSrcName)); |
| 117 | |
Erik Andersen | 4f3f757 | 2000-04-28 00:18:56 +0000 | [diff] [blame] | 118 | if (destLen + strlen(srcBasename) > BUFSIZ) { |
Mark Whitley | f57c944 | 2000-12-07 19:56:48 +0000 | [diff] [blame] | 119 | error_msg(name_too_long); |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 120 | return FALSE; |
| 121 | } |
| 122 | strcat(destName, srcBasename); |
| 123 | } |
| 124 | else if (destDirFlag == TRUE) { |
| 125 | fill_baseDest_buf(&destName[0], &destLen); |
| 126 | } |
| 127 | else { |
| 128 | srcBasename = baseSrcName; |
| 129 | } |
| 130 | if (mv_Action_first_time && (dz_i == is_mv)) { |
| 131 | mv_Action_first_time = errno = 0; |
| 132 | if (rename(fileName, destName) < 0 && errno != EXDEV) { |
Matt Kraai | 1fa1ade | 2000-12-18 03:57:16 +0000 | [diff] [blame] | 133 | perror_msg("rename(%s, %s)", fileName, destName); |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 134 | goto do_copyFile; /* Try anyway... */ |
| 135 | } |
| 136 | else if (errno == EXDEV) |
| 137 | goto do_copyFile; |
| 138 | else |
| 139 | longjmp(catch, 1); /* succeeded with rename() */ |
| 140 | } |
| 141 | do_copyFile: |
| 142 | if (preserveFlag == TRUE && statbuf->st_nlink > 1) { |
| 143 | if (is_in_ino_dev_hashtable(statbuf, &name)) { |
| 144 | if (link(name, destName) < 0) { |
Matt Kraai | 1fa1ade | 2000-12-18 03:57:16 +0000 | [diff] [blame] | 145 | perror_msg("link(%s, %s)", name, destName); |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 146 | return FALSE; |
| 147 | } |
| 148 | return TRUE; |
| 149 | } |
| 150 | else { |
| 151 | add_to_ino_dev_hashtable(statbuf, destName); |
| 152 | } |
| 153 | } |
Mark Whitley | f57c944 | 2000-12-07 19:56:48 +0000 | [diff] [blame] | 154 | return copy_file(fileName, destName, preserveFlag, followLinks, forceFlag); |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 155 | } |
| 156 | |
| 157 | static int |
Erik Andersen | 3364d78 | 2000-03-28 00:58:14 +0000 | [diff] [blame] | 158 | rm_Action(const char *fileName, struct stat *statbuf, void* junk) |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 159 | { |
| 160 | int status = TRUE; |
| 161 | |
| 162 | if (S_ISDIR(statbuf->st_mode)) { |
| 163 | if (rmdir(fileName) < 0) { |
Matt Kraai | 1fa1ade | 2000-12-18 03:57:16 +0000 | [diff] [blame] | 164 | perror_msg("rmdir(%s)", fileName); |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 165 | status = FALSE; |
| 166 | } |
| 167 | } else if (unlink(fileName) < 0) { |
Matt Kraai | 1fa1ade | 2000-12-18 03:57:16 +0000 | [diff] [blame] | 168 | perror_msg("unlink(%s)", fileName); |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 169 | status = FALSE; |
| 170 | } |
| 171 | return status; |
| 172 | } |
| 173 | |
Erik Andersen | fac10d7 | 2000-02-07 05:29:42 +0000 | [diff] [blame] | 174 | extern int cp_mv_main(int argc, char **argv) |
| 175 | { |
Eric Andersen | e7413a9 | 2000-07-14 06:19:41 +0000 | [diff] [blame] | 176 | volatile int i; |
Pavel Roskin | 93c0d9f | 2000-07-14 15:18:57 +0000 | [diff] [blame] | 177 | int c; |
Eric Andersen | f4c0226 | 2000-07-13 18:42:58 +0000 | [diff] [blame] | 178 | |
Matt Kraai | e714bce | 2000-07-12 00:53:06 +0000 | [diff] [blame] | 179 | if (*applet_name == 'c' && *(applet_name + 1) == 'p') |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 180 | dz_i = is_cp; |
| 181 | else |
| 182 | dz_i = is_mv; |
| 183 | if (argc < 3) |
| 184 | usage(cp_mv_usage[dz_i]); |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 185 | |
| 186 | if (dz_i == is_cp) { |
Erik Andersen | 59b9e87 | 2000-05-10 05:05:45 +0000 | [diff] [blame] | 187 | recursiveFlag = preserveFlag = forceFlag = FALSE; |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 188 | followLinks = TRUE; |
Eric Andersen | f4c0226 | 2000-07-13 18:42:58 +0000 | [diff] [blame] | 189 | while ((c = getopt(argc, argv, "adpRf")) != EOF) { |
| 190 | switch (c) { |
Pavel Roskin | b3d235f | 2000-06-08 18:06:37 +0000 | [diff] [blame] | 191 | case 'a': |
| 192 | followLinks = FALSE; |
| 193 | preserveFlag = TRUE; |
| 194 | recursiveFlag = TRUE; |
| 195 | break; |
| 196 | case 'd': |
| 197 | followLinks = FALSE; |
| 198 | break; |
| 199 | case 'p': |
| 200 | preserveFlag = TRUE; |
| 201 | break; |
| 202 | case 'R': |
| 203 | recursiveFlag = TRUE; |
| 204 | break; |
| 205 | case 'f': |
| 206 | forceFlag = TRUE; |
| 207 | break; |
| 208 | default: |
| 209 | usage(cp_mv_usage[is_cp]); |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 210 | } |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 211 | } |
Eric Andersen | f4c0226 | 2000-07-13 18:42:58 +0000 | [diff] [blame] | 212 | if ((argc - optind) < 2) { |
Pavel Roskin | b3d235f | 2000-06-08 18:06:37 +0000 | [diff] [blame] | 213 | usage(cp_mv_usage[dz_i]); |
Eric Andersen | 815e904 | 2000-06-06 16:15:23 +0000 | [diff] [blame] | 214 | } |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 215 | } else { /* (dz_i == is_mv) */ |
Eric Andersen | 2da90d3 | 2000-09-23 20:55:59 +0000 | [diff] [blame] | 216 | /* Initialize optind to 1, since in libc5 optind |
| 217 | * is not initialized until getopt() is called |
| 218 | * (or until sneaky programmers force it...). */ |
| 219 | optind = 1; |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 220 | recursiveFlag = preserveFlag = TRUE; |
| 221 | followLinks = FALSE; |
| 222 | } |
Eric Andersen | 815e904 | 2000-06-06 16:15:23 +0000 | [diff] [blame] | 223 | |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 224 | |
Erik Andersen | 4f3f757 | 2000-04-28 00:18:56 +0000 | [diff] [blame] | 225 | if (strlen(argv[argc - 1]) > BUFSIZ) { |
Mark Whitley | f57c944 | 2000-12-07 19:56:48 +0000 | [diff] [blame] | 226 | error_msg(name_too_long); |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 227 | goto exit_false; |
| 228 | } |
| 229 | strcpy(baseDestName, argv[argc - 1]); |
| 230 | baseDestLen = strlen(baseDestName); |
| 231 | if (baseDestLen == 0) |
| 232 | goto exit_false; |
| 233 | |
Mark Whitley | f57c944 | 2000-12-07 19:56:48 +0000 | [diff] [blame] | 234 | destDirFlag = is_directory(baseDestName, TRUE, &destStatBuf); |
Matt Kraai | adbf018 | 2000-08-06 15:36:50 +0000 | [diff] [blame] | 235 | if (argc - optind > 2 && destDirFlag == FALSE) { |
Mark Whitley | f57c944 | 2000-12-07 19:56:48 +0000 | [diff] [blame] | 236 | error_msg(not_a_directory, baseDestName); |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 237 | goto exit_false; |
| 238 | } |
| 239 | |
Eric Andersen | f4c0226 | 2000-07-13 18:42:58 +0000 | [diff] [blame] | 240 | for (i = optind; i < (argc-1); i++) { |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 241 | size_t srcLen; |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 242 | volatile int flags_memo; |
| 243 | int status; |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 244 | |
Eric Andersen | f4c0226 | 2000-07-13 18:42:58 +0000 | [diff] [blame] | 245 | baseSrcName=argv[i]; |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 246 | |
Erik Andersen | 4f3f757 | 2000-04-28 00:18:56 +0000 | [diff] [blame] | 247 | if ((srcLen = strlen(baseSrcName)) > BUFSIZ) |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 248 | name_too_long__exit(); |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 249 | |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 250 | if (srcLen == 0) continue; /* "" */ |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 251 | |
Mark Whitley | f57c944 | 2000-12-07 19:56:48 +0000 | [diff] [blame] | 252 | srcDirFlag = is_directory(baseSrcName, followLinks, &srcStatBuf); |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 253 | |
| 254 | if ((flags_memo = (recursiveFlag == TRUE && |
| 255 | srcDirFlag == TRUE && destDirFlag == TRUE))) { |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 256 | |
| 257 | struct stat sb; |
| 258 | int state = 0; |
| 259 | char *pushd, *d, *p; |
| 260 | |
Erik Andersen | 4f3f757 | 2000-04-28 00:18:56 +0000 | [diff] [blame] | 261 | if ((pushd = getcwd(NULL, BUFSIZ + 1)) == NULL) { |
Matt Kraai | 1fa1ade | 2000-12-18 03:57:16 +0000 | [diff] [blame] | 262 | perror_msg("getcwd()"); |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 263 | continue; |
| 264 | } |
| 265 | if (chdir(baseDestName) < 0) { |
Matt Kraai | 1fa1ade | 2000-12-18 03:57:16 +0000 | [diff] [blame] | 266 | perror_msg("chdir(%s)", baseSrcName); |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 267 | continue; |
| 268 | } |
Erik Andersen | 4f3f757 | 2000-04-28 00:18:56 +0000 | [diff] [blame] | 269 | if ((d = getcwd(NULL, BUFSIZ + 1)) == NULL) { |
Matt Kraai | 1fa1ade | 2000-12-18 03:57:16 +0000 | [diff] [blame] | 270 | perror_msg("getcwd()"); |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 271 | continue; |
| 272 | } |
| 273 | while (!state && *d != '\0') { |
| 274 | if (stat(d, &sb) < 0) { /* stat not lstat - always dereference targets */ |
Matt Kraai | 1fa1ade | 2000-12-18 03:57:16 +0000 | [diff] [blame] | 275 | perror_msg("stat(%s)", d); |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 276 | state = -1; |
| 277 | continue; |
Erik Andersen | 9ffdaa6 | 2000-02-11 21:55:04 +0000 | [diff] [blame] | 278 | } |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 279 | if ((sb.st_ino == srcStatBuf.st_ino) && |
| 280 | (sb.st_dev == srcStatBuf.st_dev)) { |
Mark Whitley | f57c944 | 2000-12-07 19:56:48 +0000 | [diff] [blame] | 281 | error_msg("Cannot %s `%s' into a subdirectory of itself, " |
Matt Kraai | d537a95 | 2000-07-14 01:51:25 +0000 | [diff] [blame] | 282 | "`%s/%s'\n", applet_name, baseSrcName, |
| 283 | baseDestName, baseSrcName); |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 284 | state = -1; |
| 285 | continue; |
| 286 | } |
| 287 | if ((p = strrchr(d, '/')) != NULL) { |
| 288 | *p = '\0'; |
| 289 | } |
| 290 | } |
| 291 | if (chdir(pushd) < 0) { |
Matt Kraai | 1fa1ade | 2000-12-18 03:57:16 +0000 | [diff] [blame] | 292 | perror_msg("chdir(%s)", pushd); |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 293 | free(pushd); |
| 294 | free(d); |
| 295 | continue; |
| 296 | } |
| 297 | free(pushd); |
| 298 | free(d); |
| 299 | if (state < 0) |
| 300 | continue; |
| 301 | else |
Erik Andersen | 9ffdaa6 | 2000-02-11 21:55:04 +0000 | [diff] [blame] | 302 | fill_baseDest_buf(baseDestName, &baseDestLen); |
Erik Andersen | fac10d7 | 2000-02-07 05:29:42 +0000 | [diff] [blame] | 303 | } |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 304 | status = setjmp(catch); |
| 305 | if (status == 0) { |
| 306 | mv_Action_first_time = 1; |
Mark Whitley | f57c944 | 2000-12-07 19:56:48 +0000 | [diff] [blame] | 307 | if (recursive_action(baseSrcName, |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 308 | recursiveFlag, followLinks, FALSE, |
Erik Andersen | 3364d78 | 2000-03-28 00:58:14 +0000 | [diff] [blame] | 309 | cp_mv_Action, cp_mv_Action, NULL) == FALSE) goto exit_false; |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 310 | if (dz_i == is_mv && |
Mark Whitley | f57c944 | 2000-12-07 19:56:48 +0000 | [diff] [blame] | 311 | recursive_action(baseSrcName, |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 312 | recursiveFlag, followLinks, TRUE, |
Erik Andersen | 3364d78 | 2000-03-28 00:58:14 +0000 | [diff] [blame] | 313 | rm_Action, rm_Action, NULL) == FALSE) goto exit_false; |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 314 | } |
Erik Andersen | e49d5ec | 2000-02-08 19:58:47 +0000 | [diff] [blame] | 315 | if (flags_memo) |
| 316 | *(baseDestName + baseDestLen) = '\0'; |
Erik Andersen | fac10d7 | 2000-02-07 05:29:42 +0000 | [diff] [blame] | 317 | } |
Matt Kraai | 3e856ce | 2000-12-01 02:55:13 +0000 | [diff] [blame] | 318 | return EXIT_SUCCESS; |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 319 | exit_false: |
Matt Kraai | 3e856ce | 2000-12-01 02:55:13 +0000 | [diff] [blame] | 320 | return EXIT_FAILURE; |
Erik Andersen | fac10d7 | 2000-02-07 05:29:42 +0000 | [diff] [blame] | 321 | } |
| 322 | |
Erik Andersen | 029011b | 2000-03-04 21:19:32 +0000 | [diff] [blame] | 323 | /* |
| 324 | Local Variables: |
| 325 | c-file-style: "linux" |
| 326 | c-basic-offset: 4 |
| 327 | tab-width: 4 |
| 328 | End: |
| 329 | */ |