X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=coreutils%2Frealpath.c;h=28906ba55493b48ce128b3d97a6c3e535b7dcca8;hb=1abc07dcca237e6b5c98fea740e59d59c801c9e2;hp=7fac471eb547e90431e41346f2436c300574cf60;hpb=a9b60e93eeb4d2706ebc95bafb18bd4267a03d6f;p=oweals%2Fbusybox.git diff --git a/coreutils/realpath.c b/coreutils/realpath.c index 7fac471eb..28906ba55 100644 --- a/coreutils/realpath.c +++ b/coreutils/realpath.c @@ -10,9 +10,10 @@ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ -#include "busybox.h" +#include "libbb.h" -int realpath_main(int argc, char **argv) +int realpath_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; +int realpath_main(int argc UNUSED_PARAM, char **argv) { int retval = EXIT_SUCCESS; @@ -24,19 +25,18 @@ int realpath_main(int argc, char **argv) # define resolved_path_MUST_FREE 0 #endif - if (--argc == 0) { + if (!*++argv) { bb_show_usage(); } do { - argv++; if (realpath(*argv, resolved_path) != NULL) { puts(resolved_path); } else { retval = EXIT_FAILURE; - bb_perror_msg("%s", *argv); + bb_simple_perror_msg(*argv); } - } while (--argc); + } while (*++argv); #if ENABLE_FEATURE_CLEAN_UP && resolved_path_MUST_FREE RELEASE_CONFIG_BUFFER(resolved_path);