projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Oops. Since dirent.h depends on BB_FEATURE_SH_TAB_COMPLETION, put it
[oweals/busybox.git]
/
more.c
diff --git
a/more.c
b/more.c
index 45b7c1274aa65f4f59f583c0ee5aa674dd937ad9..298e1cfb19813657a43afaa6bb0a82f0d2ce9e83 100644
(file)
--- a/
more.c
+++ b/
more.c
@@
-25,11
+25,12
@@
*
*/
*
*/
-#include "internal.h"
#include <stdio.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <fcntl.h>
#include <signal.h>
+#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/ioctl.h>
+#include "busybox.h"
#define BB_DECLARE_EXTERN
#define bb_need_help
#include "messages.c"
#define BB_DECLARE_EXTERN
#define bb_need_help
#include "messages.c"
@@
-47,15
+48,15
@@
# define getTermSettings(fd,argp) tcgetattr(fd, argp);
# endif
# define getTermSettings(fd,argp) tcgetattr(fd, argp);
# endif
-FILE *cin;
+
static
FILE *cin;
-struct termios initial_settings, new_settings;
+st
atic st
ruct termios initial_settings, new_settings;
-void gotsig(int sig)
+
static
void gotsig(int sig)
{
setTermSettings(fileno(cin), &initial_settings);
{
setTermSettings(fileno(cin), &initial_settings);
-
fprintf(stdout, "\n"
);
- exit(
TRU
E);
+
putchar('\n'
);
+ exit(
EXIT_FAILUR
E);
}
#endif /* BB_FEATURE_USE_TERMIOS */
}
#endif /* BB_FEATURE_USE_TERMIOS */
@@
-82,12
+83,8
@@
extern int more_main(int argc, char **argv)
if (argc == 0) {
file = stdin;
} else
if (argc == 0) {
file = stdin;
} else
- file = fopen(*argv, "r");
+ file =
x
fopen(*argv, "r");
- if (file == NULL) {
- perror(*argv);
- exit(FALSE);
- }
fstat(fileno(file), &st);
#ifdef BB_FEATURE_USE_TERMIOS
fstat(fileno(file), &st);
#ifdef BB_FEATURE_USE_TERMIOS
@@
-121,19
+118,19
@@
extern int more_main(int argc, char **argv)
please_display_more_prompt = 0;
lines = 0;
please_display_more_prompt = 0;
lines = 0;
- len =
fprintf(stdout,
"--More-- ");
+ len =
printf(
"--More-- ");
if (file != stdin) {
#if _FILE_OFFSET_BITS == 64
if (file != stdin) {
#if _FILE_OFFSET_BITS == 64
- len +=
fprintf(stdout,
"(%d%% of %lld bytes)",
+ len +=
printf(
"(%d%% of %lld bytes)",
#else
#else
- len +=
fprintf(stdout,
"(%d%% of %ld bytes)",
+ len +=
printf(
"(%d%% of %ld bytes)",
#endif
(int) (100 *
((double) ftell(file) /
(double) st.st_size)),
st.st_size);
}
#endif
(int) (100 *
((double) ftell(file) /
(double) st.st_size)),
st.st_size);
}
- len +=
fprintf(stdout,
"%s",
+ len +=
printf(
"%s",
#ifdef BB_FEATURE_USE_TERMIOS
""
#else
#ifdef BB_FEATURE_USE_TERMIOS
""
#else