Ver código fonte

Fix help not being garbled.

Broken since e7332578 and 3c226c5d.
Bryan Drewery 11 anos atrás
pai
commit
c8664e1986
2 arquivos alterados com 5 adições e 5 exclusões
  1. 2 2
      src/Makefile.in
  2. 3 3
      src/stringfix.cc

+ 2 - 2
src/Makefile.in

@@ -93,9 +93,9 @@ responses.cc: $(RESPONSESFILE) $(top_srcdir)/build/makeres.sh
 
 cmds.cc: help.h
 
-help.h: $(HELPFILE) $(top_srcdir)/build/makehelp.sh
+help.h: $(HELPFILE) $(top_srcdir)/build/makehelp.sh stringfix
 	@echo -e "[H]	\033[1m$*\033[0m"
-	@$(top_srcdir)/build/makehelp.sh < $(HELPFILE) > $@
+	@$(top_srcdir)/build/makehelp.sh < $(HELPFILE) | ./stringfix > $@
 
 sorthelp: sorthelp.cc ../lib/bdlib/src/libbdlib.a
 	@echo -e "Compiling: \033[1msorthelp\033[0m"

+ 3 - 3
src/stringfix.cc

@@ -13,12 +13,12 @@
 #include "config.h"
 #endif
 
-#define WTF 1524
+#define MAX_LINE_LEN 16384
 int help = 0;
 
 void garble(char **inptr, char **outptr)
 {
-  char *in = *inptr, *out = NULL, *p = NULL, obuf[WTF] = "";
+  char *in = *inptr, *out = NULL, *p = NULL, obuf[MAX_LINE_LEN] = "";
   size_t chars = 0;
   unsigned char x = 0;
 
@@ -98,7 +98,7 @@ void garble(char **inptr, char **outptr)
 
 void processline(char *line)
 {
-  char tmpin[WTF] = "", tmpout[WTF] = "", *in = NULL, *out = NULL;
+  char tmpin[MAX_LINE_LEN] = "", tmpout[MAX_LINE_LEN] = "", *in = NULL, *out = NULL;
   size_t outlen = 0;
 
   strcpy(tmpin, line);