Skip to content

Commit

Permalink
Additional cleanup after cherry-picking patches.
Browse files Browse the repository at this point in the history
  • Loading branch information
hvdijk committed Apr 25, 2024
2 parents fc11d6f + 06fdaa4 commit b577fdc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/redir.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,15 @@ openhere(union node *redir)
int pip[2];
size_t len = 0;

if (pipe(pip) < 0)
sh_error("Pipe call failed");

p = redir->nhere.doc->narg.text;
if (redir->type == NXHERE) {
expandarg(redir->nhere.doc, NULL, EXP_QUOTED);
p = stackblock();
}

if (pipe(pip) < 0)
sh_error("Pipe call failed");

len = strlen(p);
if (len <= PIPESIZE) {
xwrite(pip[1], p, len);
Expand Down
6 changes: 0 additions & 6 deletions src/var.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,6 @@ struct var *setvareq(char *s, int flags)
sh_error("%s: is read only", n);
}

if (flags & VNOSET)
goto out;

if (vp->func && (flags & VNOFUNC) == 0 && (vp->flags & VLATEFUNC) == 0)
(*vp->func)(strchrnul(s, '=') + 1);

Expand All @@ -312,8 +309,6 @@ struct var *setvareq(char *s, int flags)
flags &= ~(VEXPORT|VREADONLY);
}
} else {
if (flags & VNOSET)
goto out;
if ((flags & (VEXPORT|VREADONLY|VSTRFIXED|VUNSET)) == VUNSET)
goto out_free;
/* not found */
Expand All @@ -335,7 +330,6 @@ struct var *setvareq(char *s, int flags)
*s = '\0';
if (vp->func && flags & VLATEFUNC)
(*vp->func)(s + 1);
out:
return vp;
}

Expand Down
1 change: 0 additions & 1 deletion src/var.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
#define VSTACK 0x10 /* text is allocated on the stack */
#define VUNSET 0x20 /* the variable is not set */
#define VNOFUNC 0x40 /* don't call the callback function */
#define VNOSET 0x80 /* do not set variable - just readonly test */
#define VNOSAVE 0x100 /* when text is on the heap before setvareq */
#define VLATEFUNC 0x200 /* call the callback function after the value has been changed */
#define VUSER1 0x400 /* special flag with per-variable meaning
Expand Down

0 comments on commit b577fdc

Please sign in to comment.