]> granicus.if.org Git - graphviz/commitdiff
expr expush: remove unused string path
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 14 Aug 2022 21:45:05 +0000 (14:45 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 20 Aug 2022 03:02:56 +0000 (20:02 -0700)
As of the previous commit, this is unused.

lib/expr/exgram.h
lib/expr/expr.h
lib/expr/extoken.c

index 4288785246c494fa97bff2c7079e306768c714ac..6c34f4015d2214fd832de113e619a5517e666dbc 100644 (file)
@@ -814,9 +814,7 @@ preprint(Exnode_t* args)
  * push a new input stream and program
  */
 
-int
-expush(Expr_t* p, const char* name, int line, const char* sp, Sfio_t* fp)
-{
+int expush(Expr_t *p, const char *name, int line, Sfio_t *fp) {
        Exinput_t*      in;
        char*           s;
        char                    buf[PATH_MAX];
@@ -828,25 +826,22 @@ expush(Expr_t* p, const char* name, int line, const char* sp, Sfio_t* fp)
        }
        if (!p->input)
                p->input = &expr.null;
-       if (!(in->bp = in->sp = (char*)sp))
+       in->bp = in->sp = NULL;
+       if ((in->fp = fp))
+               in->close = 0;
+       else if (name)
        {
-               if ((in->fp = fp))
-                       in->close = 0;
-               else if (name)
+               if (!(s = pathfind(name, p->disc->lib, p->disc->type, buf, sizeof(buf))) || !(in->fp = sfopen(s, "r")))
                {
-                       if (!(s = pathfind(name, p->disc->lib, p->disc->type, buf, sizeof(buf))) || !(in->fp = sfopen(s, "r")))
-                       {
-                               exerror("%s: file not found", name);
-                               in->bp = in->sp = "";
-                       }
-                       else
-                       {
-                               name = vmstrdup(p->vm, s);
-                               in->close = 1;
-                       }
+                       exerror("%s: file not found", name);
+                       in->bp = in->sp = "";
+               }
+               else
+               {
+                       name = vmstrdup(p->vm, s);
+                       in->close = 1;
                }
        }
-       else in->fp = 0;
        if (!(in->next = p->input)->next)
        {
                p->errors = 0;
@@ -938,7 +933,7 @@ int excomp(Expr_t *p, const char *name, int line, Sfio_t *fp) {
                if (!p->input)
                        return -1;
        }
-       else if (expush(p, name, line, NULL, fp))
+       else if (expush(p, name, line, fp))
                return -1;
        else
                p->input->unit = line >= 0;
index 047c5cdf762de748e0f137a11ddbd0135cab1f46..1ce7b0fc7a49c802bb631b0f641ac0ab96e050ae 100644 (file)
@@ -261,7 +261,7 @@ extern Exnode_t*    exnewnode(Expr_t*, int, int, int, Exnode_t*, Exnode_t*);
 extern char*           exnospace(void);
 extern Expr_t*         exopen(Exdisc_t*);
 extern int             expop(Expr_t*);
-extern int             expush(Expr_t*, const char*, int, const char*, Sfio_t*);
+extern int             expush(Expr_t*, const char*, int, Sfio_t*);
 extern char*           exstash(Sfio_t*, Vmalloc_t*);
 extern int             extoken_fn(Expr_t*);
 extern char*           exstring(Expr_t *, char *);
index 7d28466ed8a9bc4b61e07131281c6e59be6d47bd..863f816271f88d4c351787e0e76305afb5af393d 100644 (file)
@@ -482,7 +482,7 @@ extoken_fn(Expr_t* ex)
                                        {
                                                if (extoken_fn(ex) != STRING)
                                                        exerror("#%s: string argument expected", s);
-                                               else if (!expush(ex, ex_lval.string, 1, NULL, NULL))
+                                               else if (!expush(ex, ex_lval.string, 1, NULL))
                                                {
                                                        setcontext(ex);
                                                        goto again;