Author Topic: Fix broken pager output for help  (Read 1539 times)

Offline quixadhal

  • BFF
  • ***
  • Posts: 642
    • View Profile
    • WileyMUD
Fix broken pager output for help
« on: February 14, 2013, 01:14:02 pm »
The help system breaks when displaying a large file on a large terminal, because of a string size limit put in place in the 19th century, when 7900 bytes was a LOT of memory.

Code: [Select]
bloodlines@lenin:~/lib/daemon$ git diff ../secure/sefun/strings.c
diff --git a/lib/secure/sefun/strings.c b/lib/secure/sefun/strings.c
index 1975679..65d53c0 100755
--- a/lib/secure/sefun/strings.c
+++ b/lib/secure/sefun/strings.c
@@ -87,6 +87,8 @@ varargs string wrap(string str, int x) {
             else x = 79;
         }
     }
+    return sprintf("%-=" + x + "s\n", str);
+    /*
     if(sizeof(str) < 7900) return sprintf("%-=" + x + "s\n", str);
     else {
         string tmpfile = generate_tmp();
@@ -96,6 +98,7 @@ varargs string wrap(string str, int x) {
         str += "\n*** TRUNCATED ***\n";
         return sprintf("%-=" + x + "s\n", str);
     }
+    */
 }

 varargs mixed convert_string(string str, int flag) {