| Anonymous | Login | Signup for a new account | 2010-02-09 15:01 UTC |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
| ID | Category | Severity | Type | Date Submitted | Last Update | ||||||||
| 0000124 | [1003.1(2008)/Issue 7] Shell and Utilities | Objection | Omission | 2009-07-15 04:10 | 2009-10-08 15:49 | ||||||||
| Reporter | eblake | View Status | public | ||||||||||
| Assigned To | ajosey | ||||||||||||
| Priority | normal | Resolution | Accepted As Marked | ||||||||||
| Status | Resolved | ||||||||||||
| Name | Eric Blake | ||||||||||||
| Organization | |||||||||||||
| User Reference | ebb.tilde | ||||||||||||
| Section | Tilde Expansion | ||||||||||||
| Page Number | 2305 | ||||||||||||
| Line Number | 72682 | ||||||||||||
| Interp Status | --- | ||||||||||||
| Final Accepted Text | Note: 0000199 | ||||||||||||
| Summary | 0000124: tilde expansion and double slash file names | ||||||||||||
| Description |
The standard is silent on how tilde expansion must behave on implementations where // is different than /. See also https://www.opengroup.org/sophocles/show_mail.tpl?CALLER=show_archive.tpl&source=L&listname=austin-group-l&id=8491. [^] This proposal tries to codify the approach used when porting shells to cygwin, where // really is distinct from /. The intent is that: HOME=/; a=~:~/dir:~//dir; HOME=//; b=~:~/dir:~//dir; echo $a $b outputs "/:/dir://dir [^] //://dir:///dir", [^] such that using one slash between a tilde prefix and subsequent text never corrupts / into // or // into /, but using two slashes after a tilde prefix intentionally picks up the opposite sense. If one wants to avoid the // issue altogether but still use the root directory, then HOME can be set to ///. However, this could have a negative impact to existing implementations, where // is identical to / during pathname resolution. On those platforms, not deleting a trailing slash during tilde-expansion will have no impact to pathname resolution, but leads to observably different textual expansion. So it may be worth adding additional wording that permits platforms to skip stripping the trailing slash if // is identical to /. |
||||||||||||
| Desired Action |
After the existing text at line 72682: If the login name is null (that is, the tilde-prefix contains only the tilde), the tilde-prefix is replaced by the value of the variable HOME. If HOME is unset, the results are unspecified. Otherwise, the tilde-prefix shall be replaced by a pathname of the initial working directory associated with the login name obtained using the getpwnam( ) function as defined in the System Interfaces volume of POSIX.1-2008. If the system does not recognize the login name, the results are undefined. Add a new paragraph: If the replacement provided by the variable HOME or by getpwnam( ) ends in a <slash>, and the tilde-prefix was terminated by a <slash>, then the trailing slash in the replacement shall be omitted when concatenating the expansion with the rest of the word. If the tilde-prefix was terminated by <colon> or the end of the word, then the trailing slash of the replacement is left intact. |
||||||||||||
| Tags | No tags attached. | ||||||||||||
| Attached Files | |||||||||||||
|
|
|||||||||||||
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2009-07-15 04:10 | eblake | New Issue | |
| 2009-07-15 04:10 | eblake | Status | New => Under Review |
| 2009-07-15 04:10 | eblake | Assigned To | => ajosey |
| 2009-07-15 04:10 | eblake | Name | => Eric Blake |
| 2009-07-15 04:10 | eblake | User Reference | => ebb.tilde |
| 2009-07-15 04:10 | eblake | Section | => Tilde Expansion |
| 2009-07-15 04:10 | eblake | Page Number | => 2305 |
| 2009-07-15 04:10 | eblake | Line Number | => 72682 |
| 2009-08-20 15:59 | ajosey | Note Added: 0000199 | |
| 2009-10-08 15:49 | msbrown | Interp Status | => --- |
| 2009-10-08 15:49 | msbrown | Final Accepted Text | => Note: 0000199 |
| 2009-10-08 15:49 | msbrown | Status | Under Review => Resolved |
| 2009-10-08 15:49 | msbrown | Resolution | Open => Accepted As Marked |
| Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |