Link [ NetBSD | NetBSD OpenGrok source search | PR fulltext-search | Summary of daily snapshot builds | history of daily build result | pkgsrc commit viewer ]


   
        usage: [branch:branch] [user:user] [path@revision] keyword [... [-excludekeyword [...]]] (e.g. branch:MAIN sys/arch/arm, if_wm.c@1.234 )




switch to index mode

recent branches: MAIN (4m)  netbsd-10 (31d)  netbsd-9 (31d)  netbsd-8 (36d) 

2024-06-16 16:08:29 UTC Now

2017-10-25 06:51:36 UTC netbsd-8 commitmail json YAML

Pull up following revision(s) (requested by kre in ticket #310):
bin/sh/expand.c: revision 1.121
bin/sh/sh.1: revision 1.167 via patch
Three fixes and a change to ~ expansions
1. A serious bug introduced 3 1/2 months ago (approx) (rev 1.116) which
  broke all but the simple cases of ~ expansions is fixed (amazingly,
  given the magnitude of this problem, no-one noticed!)
2. An ancient bug (probably from when ~ expansion was first addedin 1994, and
  certainly is in NetBSD-6 vintage shells) where ${UnSeT:-~} (and similar)
  does not expand the ~ is fixed (note that ${UnSeT:-~/} does expand,
  this should give a clue to the cause of the problem.
3. A fix/change to make the effects of ~ expansions on ${UnSeT:=whatever}
  identical to those in UnSeT=whatever  In particular, with HOME=/foo
  ${UnSeT:=~:~} now assigns, and expands to, /foo:/foo rather than ~:~
  just as VAR=~:~ assigns /foo:/foo to VAR.  Note this is even after the
  previous fix (ie: appending a '/' would not change the results here.)
  It is hard to call this one a bug fix for certain (though I believe it is)
  as many other shells also produce different results for the ${V:=...}
  expansions than  they do for V=... (though not all the same as we did).
  POSIX is not clear about this, expanding ~ after : in VAR=whatever
  assignments is clear, whether ${U:=whatever} assignments should be
  treated the same way is not stated, one way or the other.
4. Change to make ':' terminate the user name in a ~ expansion in all cases,
  not only in assignments.  This makes sense, as ':' is one character that
  cannot occur in user names, no matter how otherwise weird they become.
  bash (incl in posix mode) ksh93 and bosh all act this way, whereas most
  other shells (and POSIX) do not.  Because this is clearly an extension
  to POSIX, do this one only when not in posix mode (not set -o posix).

(snj)