• R/O
  • SSH
  • HTTPS

yash: 提交


Commit MetaInfo

修訂4220 (tree)
時間2022-11-16 01:15:07
作者magicant

Log Message

Update exported $DIRSTACK value in pushd/popd

Change Summary

差異

--- yash/trunk/NEWS (revision 4219)
+++ yash/trunk/NEWS (revision 4220)
@@ -29,6 +29,8 @@
2929 in a for loop.
3030 * The ">" redirection with the noclobber option no longer hangs
3131 when the operand names a symbolic link to a non-existing file.
32+ * The exported value of the $DIRSTACK variable was not being
33+ updated correctly in the "pushd" and "popd" built-ins.
3234
3335 ----------------------------------------------------------------------
3436 Yash 2.53 (2022-08-23)
--- yash/trunk/variable.c (revision 4219)
+++ yash/trunk/variable.c (revision 4220)
@@ -3114,6 +3114,8 @@
31143114 remove_dirstack_entry_at(var, stackindex);
31153115 if (remove_dups)
31163116 remove_dirstack_dups(var);
3117+ if (var->v_type & VF_EXPORT)
3118+ update_environment(L VAR_DIRSTACK);
31173119 return Exit_SUCCESS;
31183120 }
31193121
@@ -3231,6 +3233,8 @@
32313233
32323234 if (stackindex < var->v_valc) {
32333235 remove_dirstack_entry_at(var, stackindex);
3236+ if (var->v_type & VF_EXPORT)
3237+ update_environment(L VAR_DIRSTACK);
32343238 return Exit_SUCCESS;
32353239 }
32363240
@@ -3243,6 +3247,8 @@
32433247 var->v_vals[var->v_valc] = NULL;
32443248 result = change_directory(newpwd, true, true);
32453249 free(newpwd);
3250+ if (var->v_type & VF_EXPORT)
3251+ update_environment(L VAR_DIRSTACK);
32463252 return result;
32473253 }
32483254
Show on old repository browser