*/
-#include "busybox.h"
#include <stdio.h>
#include <errno.h>
#include <getopt.h>
-#include <pwd.h>
+#include <string.h>
+#include <stdlib.h>
+#include "busybox.h"
+#include "pwd_grp/pwd.h"
+#include "pwd_grp/grp.h"
/*struct passwd *getpwnam();*/
char *p;
if (fgets (buf, sizeof(buf), stdin) == NULL) {
- errorMsg("%s: Short file\n", inname);
+ error_msg("%s: Short file", inname);
return FALSE;
}
p = buf;
if (fgets (buf, sizeof(buf), stdin) == NULL
|| strcmp (buf, "end\n")) {
- errorMsg("%s: No `end' line\n", inname);
+ error_msg("%s: No `end' line", inname);
return FALSE;
}
unsigned char *p;
if (fgets (buf, sizeof(buf), stdin) == NULL) {
- errorMsg("%s: Short file\n", inname);
+ error_msg("%s: Short file", inname);
return FALSE;
}
p = buf;
if (memcmp (buf, "====", 4) == 0)
break;
if (last_data != 0) {
- errorMsg("%s: data following `=' padding character\n", inname);
+ error_msg("%s: data following `=' padding character", inname);
return FALSE;
}
while ((b64_tab[*p] & '\100') != 0)
if (*p == '\n' || *p++ == '=') {
- errorMsg("%s: illegal line\n", inname);
+ error_msg("%s: illegal line", inname);
return FALSE;
}
c2 = b64_tab[*p++];
while (b64_tab[*p] == '\177')
if (*p++ == '\n') {
- errorMsg("%s: illegal line\n", inname);
+ error_msg("%s: illegal line", inname);
return FALSE;
}
if (*p == '=') {
while (b64_tab[*p] == '\177')
if (*p++ == '\n') {
- errorMsg("%s: illegal line\n", inname);
+ error_msg("%s: illegal line", inname);
return FALSE;
}
putchar (c1 << 2 | c2 >> 4);
while (1) {
if (fgets (buf, sizeof (buf), stdin) == NULL) {
- errorMsg("%s: No `begin' line\n", inname);
+ error_msg("%s: No `begin' line", inname);
return FALSE;
}
while (*p != '/')
++p;
if (*p == '\0') {
- errorMsg("%s: Illegal ~user\n", inname);
+ error_msg("%s: Illegal ~user", inname);
return FALSE;
}
*p++ = '\0';
pw = getpwnam (buf + 1);
if (pw == NULL) {
- errorMsg("%s: No user `%s'\n", inname, buf + 1);
+ error_msg("%s: No user `%s'", inname, buf + 1);
return FALSE;
}
n = strlen (pw->pw_dir);
&& (freopen (outname, "w", stdout) == NULL
|| chmod (outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO))
)) {
- errorMsg("%s: %s %s\n", outname, inname, strerror(errno)); /* */
+ perror_msg("%s", outname); /* */
return FALSE;
}
break;
default:
- usage(uudecode_usage);
+ show_usage();
}
}
if (decode (argv[optind], outname) != 0)
exit_status = FALSE;
} else {
- errorMsg("%s: %s\n", argv[optind], strerror(errno));
+ perror_msg("%s", argv[optind]);
exit_status = EXIT_FAILURE;
}
optind++;