#include <sys/types.h>
#include "busybox.h"
-static const int ASCII = 0377;
+/* This must be a #define, since when DODEBUG and BUFFERS_GO_IN_BSS are
+ * enabled, we otherwise get a "storage size isn't constant error. */
+#define ASCII 0377
/* some "globals" shared across this file */
static char com_fl, del_fl, sq_fl;
if (in_index == read_chars) {
if ((read_chars = read(0, (char *) pinput, BUFSIZ)) <= 0) {
if (write(1, (char *) poutput, out_index) != out_index)
- write(2, write_error, strlen(write_error));
+ error_msg("%s", write_error);
exit(0);
}
in_index = 0;
continue;
poutput[out_index++] = last = coded;
if (out_index == BUFSIZ) {
- if (write(1, (char *) poutput, out_index) != out_index) {
- write(2, write_error, strlen(write_error));
- exit(1);
- }
+ if (write(1, (char *) poutput, out_index) != out_index)
+ error_msg_and_die("%s", write_error);
out_index = 0;
}
}
if (*arg == '\\') {
arg++;
*buffer++ = process_escape_sequence(&arg);
+ } else if (*(arg+1) == '-') {
+ ac = *(arg+2);
+ if(ac == 0) {
+ *buffer++ = *arg++;
+ continue;
+ }
+ i = *arg;
+ while (i <= ac)
+ *buffer++ = i++;
+ arg += 3; /* Skip the assumed a-z */
} else if (*arg == '[') {
arg++;
i = *arg++;