VERSION = 1
PATCHLEVEL = 8
-SUBLEVEL = 2
+SUBLEVEL = 3
EXTRAVERSION =
NAME = Unnamed
#warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
#warning Note that glibc is unsuitable for static linking anyway.
#warning If you still want to do it, remove -Wl,--gc-sections
-#warning from top-level Makefile and remove this warning.
+#warning from file scripts/trylink and remove this warning.
#error Aborting compilation.
#endif
#if ENABLE_FEATURE_VI_COLON
char *initial_cmds[3]; // currently 2 entries, NULL terminated
#endif
+ char readbuffer[MAX_LINELEN];
};
#define G (*ptr_to_globals)
#define text (G.text )
#define term_orig (G.term_orig )
#define term_vi (G.term_vi )
#define initial_cmds (G.initial_cmds )
+#define readbuffer (G.readbuffer )
+#define INIT_G() do { \
+ PTR_TO_GLOBALS = xzalloc(sizeof(G)); \
+} while (0)
static int init_text_buffer(char *); // init from file or create new
static void edit_file(char *); // edit one file
my_pid = getpid();
#endif
- PTR_TO_GLOBALS = xzalloc(sizeof(G));
+ INIT_G();
#if ENABLE_FEATURE_VI_CRASHME
srand((long) my_pid);
return safe_poll(pfd, 1, hund*10) > 0;
}
-#define readbuffer bb_common_bufsiz1
-
static int readed_for_parse;
//----- IO Routines --------------------------------------------
#endif
#define setTermSettings(fd, argp) tcsetattr(fd, TCSANOW, argp)
-#define getTermSettings(fd, argp) tcgetattr(fd, argp);
+#define getTermSettings(fd, argp) tcgetattr(fd, argp)
static sighandler_t previous_SIGWINCH_handler;
smalluint prevc;
#endif
- getTermSettings(0, (void *) &initial_settings);
- /* Happens when e.g. stty -echo was run before */
- if (!(initial_settings.c_lflag & ECHO)) {
+ if (getTermSettings(0, (void *) &initial_settings) < 0
+ /* Happens when e.g. stty -echo was run before */
+ || !(initial_settings.c_lflag & ECHO)
+ ) {
parse_prompt(prompt);
fflush(stdout);
fgets(command, maxsize, stdin);
}
if (last) {
- printf(" %u.%03ums\n", last / 1000, last % 1000);
+ unsigned diff = MONOTONIC_US() - last;
+ printf(" %u.%03ums\n", diff / 1000, diff % 1000);
} else {
printf(" UNSOLICITED?\n");
}