Skip to content

Commit

Permalink
var: Remove unused VNOSET
Browse files Browse the repository at this point in the history
The bit VNOSET is no longer used.  Remove it.

Signed-off-by: Herbert Xu <[email protected]>
(cherry picked from commit 177072c2e718d2fa9758be9925b8558aedbc0227)
  • Loading branch information
herbertx authored and hvdijk committed Apr 25, 2024
1 parent fc11d6f commit 7af25cd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 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 Down
2 changes: 1 addition & 1 deletion src/var.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#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 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 7af25cd

Please sign in to comment.