|| defined (BB_INSMOD)
/* same conditions as recursiveAction */
#define bb_need_name_too_long
-#define bb_need_memory_exhausted
#endif
+#define bb_need_memory_exhausted
#define BB_DECLARE_EXTERN
#include "messages.c"
file = fopen(filename, "r");
if (file == NULL) {
- /* Do not complain. It is ok for /etc/password and
+ /* Do not complain. It is ok for /etc/passwd and
* friends to be missing... */
return (-1);
}
#endif /* ! BB_REGEXP && (BB_GREP || BB_SED) */
-#if defined BB_FIND
+#if defined BB_FIND || defined BB_INSMOD
/*
* Routine to see if a text string is matched by a wildcard pattern.
* Returns TRUE if the text is matched, or FALSE if it is not matched
return TRUE;
}
-#endif /* BB_FIND */
+#endif /* BB_FIND || BB_INSMOD */
}
#endif
-const unsigned int CSTRING_BUFFER_LENGTH = 128;
+const unsigned int CSTRING_BUFFER_LENGTH = 1024;
/* recursive parser that returns cstrings of arbitrary length
* from a FILE*
*/
char *cstring;
char buffer[CSTRING_BUFFER_LENGTH];
int target = CSTRING_BUFFER_LENGTH * depth;
- int i, len;
- int size;
+ int c, i, len, size;
/* fill buffer */
i = 0;
- while ((buffer[i] = fgetc(f)) != EOF) {
+ while ((c = fgetc(f)) != EOF) {
+ buffer[i] = (char) c;
if (buffer[i++] == 0x0a) { break; }
if (i == CSTRING_BUFFER_LENGTH) { break; }
}