/ Check-in [3ddfb7d113]
DEMO | DOWNLOAD | DEPLOY | SEARCH
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix build without readline.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3ddfb7d113d1e86967239cf01f90b9a9f069afc8
User & Date: pmacdona 2019-05-07 21:19:13
Context
2019-05-08
02:23
Interactive mode fixes. check-in: ad72e1facf user: pmacdona tags: trunk
2019-05-07
21:19
Fix build without readline. check-in: 3ddfb7d113 user: pmacdona tags: trunk
16:53
Release "2.8.26". Interactive mode: change prompt to $ and an Interp option for changing it. Add history command for non-error cmds. check-in: 00607b6d2b user: pmacdona tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/jsi.c.

23883
23884
23885
23886
23887
23888
23889

23890
23891
23892
23893
23894

23895
23896
23897
23898
23899
23900
23901
.....
23902
23903
23904
23905
23906
23907
23908

23909
23910

23911
23912
23913
23914
23915
23916
23917
        if (buf[0] == 0) {
            Jsi_DSSetLength(&dStr, 0);
            continue;
        }
        bool wantHelp = 0;
        if (interp->onEval == NULL) {
            /* Convenience: add semicolon to "var" statements (required by parser). */

            if (!Jsi_Strncmp(buf, "history", 7) && buf[7] == 0) {
                fputs(Jsi_DSValue(&sHist), stdout);
                Jsi_DSSetLength(&dStr, 0);
                continue;
            }

            if (!Jsi_Strncmp(buf, "help", 4) && (buf[4] == 0 || isspace(buf[4]))) {
                if (!chkHelp++)
                    hasHelp = (Jsi_PkgRequire(interp, "Jsi_Help", 0)>=0);
                if (hasHelp) {
                    wantHelp = 1;
                    char tbuf[BUFSIZ];
                    snprintf(tbuf, sizeof(tbuf), "return runModule('Jsi_Help', '%s'.trim().split(null));", buf+4);
................................................................................
                    rc = Jsi_EvalString(interp, tbuf, JSI_RETURN);
                }
            }
            if (!wantHelp) {
                if (!Jsi_Strncmp(buf,"var ", 4) && Jsi_Strchr(buf, '\n')==NULL && Jsi_Strchr(buf, ';')==NULL)
                    Jsi_Strcpy(buf+Jsi_Strlen(buf), ";"); // Added space above so strcat ok.
                rc = Jsi_EvalString(interp, buf, JSI_EVAL_RETURN);

                if (rc == JSI_OK)
                    Jsi_DSAppend(&sHist, buf, "\n", NULL);

            }
        }
        else
        {
            Jsi_Value *func = interp->onEval;
            if (func && Jsi_ValueIsFunction(interp, func)) {
                Jsi_Value *items[1] = {};







>





>







 







>


>







23883
23884
23885
23886
23887
23888
23889
23890
23891
23892
23893
23894
23895
23896
23897
23898
23899
23900
23901
23902
23903
.....
23904
23905
23906
23907
23908
23909
23910
23911
23912
23913
23914
23915
23916
23917
23918
23919
23920
23921
        if (buf[0] == 0) {
            Jsi_DSSetLength(&dStr, 0);
            continue;
        }
        bool wantHelp = 0;
        if (interp->onEval == NULL) {
            /* Convenience: add semicolon to "var" statements (required by parser). */
#ifdef JSI_HAS_READLINE
            if (!Jsi_Strncmp(buf, "history", 7) && buf[7] == 0) {
                fputs(Jsi_DSValue(&sHist), stdout);
                Jsi_DSSetLength(&dStr, 0);
                continue;
            }
#endif
            if (!Jsi_Strncmp(buf, "help", 4) && (buf[4] == 0 || isspace(buf[4]))) {
                if (!chkHelp++)
                    hasHelp = (Jsi_PkgRequire(interp, "Jsi_Help", 0)>=0);
                if (hasHelp) {
                    wantHelp = 1;
                    char tbuf[BUFSIZ];
                    snprintf(tbuf, sizeof(tbuf), "return runModule('Jsi_Help', '%s'.trim().split(null));", buf+4);
................................................................................
                    rc = Jsi_EvalString(interp, tbuf, JSI_RETURN);
                }
            }
            if (!wantHelp) {
                if (!Jsi_Strncmp(buf,"var ", 4) && Jsi_Strchr(buf, '\n')==NULL && Jsi_Strchr(buf, ';')==NULL)
                    Jsi_Strcpy(buf+Jsi_Strlen(buf), ";"); // Added space above so strcat ok.
                rc = Jsi_EvalString(interp, buf, JSI_EVAL_RETURN);
#ifdef JSI_HAS_READLINE
                if (rc == JSI_OK)
                    Jsi_DSAppend(&sHist, buf, "\n", NULL);
#endif
            }
        }
        else
        {
            Jsi_Value *func = interp->onEval;
            if (func && Jsi_ValueIsFunction(interp, func)) {
                Jsi_Value *items[1] = {};

Changes to src/jsiUtils.c.

1016
1017
1018
1019
1020
1021
1022

1023
1024
1025
1026
1027

1028
1029
1030
1031
1032
1033
1034
....
1035
1036
1037
1038
1039
1040
1041

1042
1043

1044
1045
1046
1047
1048
1049
1050
        if (buf[0] == 0) {
            Jsi_DSSetLength(&dStr, 0);
            continue;
        }
        bool wantHelp = 0;
        if (interp->onEval == NULL) {
            /* Convenience: add semicolon to "var" statements (required by parser). */

            if (!Jsi_Strncmp(buf, "history", 7) && buf[7] == 0) {
                fputs(Jsi_DSValue(&sHist), stdout);
                Jsi_DSSetLength(&dStr, 0);
                continue;
            }

            if (!Jsi_Strncmp(buf, "help", 4) && (buf[4] == 0 || isspace(buf[4]))) {
                if (!chkHelp++)
                    hasHelp = (Jsi_PkgRequire(interp, "Jsi_Help", 0)>=0);
                if (hasHelp) {
                    wantHelp = 1;
                    char tbuf[BUFSIZ];
                    snprintf(tbuf, sizeof(tbuf), "return runModule('Jsi_Help', '%s'.trim().split(null));", buf+4);
................................................................................
                    rc = Jsi_EvalString(interp, tbuf, JSI_RETURN);
                }
            }
            if (!wantHelp) {
                if (!Jsi_Strncmp(buf,"var ", 4) && Jsi_Strchr(buf, '\n')==NULL && Jsi_Strchr(buf, ';')==NULL)
                    Jsi_Strcpy(buf+Jsi_Strlen(buf), ";"); // Added space above so strcat ok.
                rc = Jsi_EvalString(interp, buf, JSI_EVAL_RETURN);

                if (rc == JSI_OK)
                    Jsi_DSAppend(&sHist, buf, "\n", NULL);

            }
        }
        else
        {
            Jsi_Value *func = interp->onEval;
            if (func && Jsi_ValueIsFunction(interp, func)) {
                Jsi_Value *items[1] = {};







>





>







 







>


>







1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
....
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
        if (buf[0] == 0) {
            Jsi_DSSetLength(&dStr, 0);
            continue;
        }
        bool wantHelp = 0;
        if (interp->onEval == NULL) {
            /* Convenience: add semicolon to "var" statements (required by parser). */
#ifdef JSI_HAS_READLINE
            if (!Jsi_Strncmp(buf, "history", 7) && buf[7] == 0) {
                fputs(Jsi_DSValue(&sHist), stdout);
                Jsi_DSSetLength(&dStr, 0);
                continue;
            }
#endif
            if (!Jsi_Strncmp(buf, "help", 4) && (buf[4] == 0 || isspace(buf[4]))) {
                if (!chkHelp++)
                    hasHelp = (Jsi_PkgRequire(interp, "Jsi_Help", 0)>=0);
                if (hasHelp) {
                    wantHelp = 1;
                    char tbuf[BUFSIZ];
                    snprintf(tbuf, sizeof(tbuf), "return runModule('Jsi_Help', '%s'.trim().split(null));", buf+4);
................................................................................
                    rc = Jsi_EvalString(interp, tbuf, JSI_RETURN);
                }
            }
            if (!wantHelp) {
                if (!Jsi_Strncmp(buf,"var ", 4) && Jsi_Strchr(buf, '\n')==NULL && Jsi_Strchr(buf, ';')==NULL)
                    Jsi_Strcpy(buf+Jsi_Strlen(buf), ";"); // Added space above so strcat ok.
                rc = Jsi_EvalString(interp, buf, JSI_EVAL_RETURN);
#ifdef JSI_HAS_READLINE
                if (rc == JSI_OK)
                    Jsi_DSAppend(&sHist, buf, "\n", NULL);
#endif
            }
        }
        else
        {
            Jsi_Value *func = interp->onEval;
            if (func && Jsi_ValueIsFunction(interp, func)) {
                Jsi_Value *items[1] = {};