]> skyeroc.xyz Git - dgamelaunch/commitdiff
...except ncurses prevents using escape sequences. Grh.
authorPasi Kallinen <paxed@alt.org>
Sun, 9 Oct 2011 18:01:59 +0000 (18:01 +0000)
committerPasi Kallinen <paxed@alt.org>
Sun, 9 Oct 2011 18:01:59 +0000 (18:01 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@616 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

dgamelaunch.c
examples/dgamelaunch.conf

index fca1b08964f362ce0b6806413ed2bf5c06221cae..463b958281b7352a9ef5a682cbcabc1d37e40f85 100644 (file)
@@ -369,55 +369,6 @@ idle_alarm_reset(void)
 
 /* ************************************************************* */
 
-char *
-bannerfuncmangle(char *buf, char *fromstr, char *(*strmangler)(char *))
-{
-    static char bufnew[81];
-    char *loc;
-    char *b = buf;
-    char *bnpos = bufnew;
-    memset(bufnew, 0, 80);
-
-    if (strstr(b, fromstr)) {
-       while ((loc = strstr(b, fromstr)) != NULL) {
-           char *fn = loc + strlen(fromstr);
-           if (*fn == '(') {
-               char *fn_end = strchr(fn, ')');
-               if (fn_end) {
-                   char funcparam[81];
-                   char *funcout;
-                   fn++;
-                   memset(funcparam, 0, 80);
-                   memcpy(funcparam, fn, (fn_end - fn));
-                   funcout = (*strmangler)(funcparam);
-                   memcpy(bnpos, b, (loc - b));
-                   bnpos += strlen(bnpos);
-                   b = fn_end;
-                   b++;
-                   memcpy(bnpos, funcout, strlen(funcout));
-                   bnpos += strlen(funcout);
-               }
-           }
-       }
-    }
-    strcpy(bnpos, b);
-    return bufnew;
-}
-
-char *
-bannermangler_func_esc(char *str)
-{
-    static char buf[11];
-    int len = strlen(str);
-    if (len > 7) len = 7;
-    buf[0] = '\x1b';
-    buf[1] = '[';
-    strncpy((buf + 2), str, len);
-    buf[len+2] = 'm';
-    buf[len+3] = '\0';
-    return buf;
-}
-
 
 char *
 bannerstrmangle(char *buf, char *fromstr, char *tostr)
@@ -576,7 +527,6 @@ loadbanner (char *fname, struct dg_banner *ban)
          } else {
              strncpy(bufnew, bannerstrmangle(bufnew, "$USERNAME", "[Anonymous]"), 80);
          }
-         strncpy(bufnew, bannerfuncmangle(bufnew, "$ESC", bannermangler_func_esc), 80);
          banner_addline(ban, bufnew);
       }
 
index c1a1079fa5d273f5a53284bf69c979c9522fe6fc..a5f92c063f7ae08028a239c666a7851b72c55167 100644 (file)
@@ -58,8 +58,6 @@ bannervars = [ "$MOTDTIME" = "2011.10.08",
 # - $VERSION replaced with "dgamelaunch v" + dgl version number.
 # - $USERNAME replaced with logged-in user's name, or with "[Anonymous]"
 # - $INCLUDE(filename) the named file will be inserted here.
-# - $ESC(code) Allows to use ECMA-48 SGR escape sequences, setting
-#    text color and attributes. will output "ESC [ code m"
 banner = "/dgl-banner"
 
 # The following two options are fairly insecure. They will force us to