View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000230 | 1003.1(2008)/Issue 7 | Shell and Utilities | public | 2010-03-29 07:59 | 2013-04-16 13:06 |
Reporter | Konrad_Schwarz | Assigned To | ajosey | ||
Priority | normal | Severity | Editorial | Type | Clarification Requested |
Status | Closed | Resolution | Accepted | ||
Name | Konrad Schwarz | ||||
Organization | Siemens AG | ||||
User Reference | cd-algorithm-simlification | ||||
Section | cd | ||||
Page Number | http://www.opengroup.org/onlinepubs/9699919799/utilities/cd.html | ||||
Line Number | Section DESCRIPTION, Step 6 | ||||
Interp Status | --- | ||||
Final Accepted Text | |||||
Summary | 0000230: Simplify step 6 | ||||
Description | There is some overlap in the actions of step 6 and 7. The casual reader might be mislead into thinking that the "prefixing" of the *curpath* variable with _PWD_ and a slash could happen twice. Removing the prefixing action in step 6 does not change the algorithm and eliminates this source of confusion by making the presentation simpler. Below is a more precise analysis of the algorithm, taken from my post to austin-group-l@opengroup.org on 2010-03-26: If -P is not in effect, step 6 says that *curpath* is set to the concatenation of _PWD_, possibly a slash, and the operand, then to proceed with step 7. If -P is not in effect, step 7 says that *curpath* is prefixed with _PWD_ and possibly a slash if it does not begin with a slash character. The only other ways to get to step 7 are via step 3, if *curpath* begins with a slash, and step 5, if the concatenation results in an existing directory. The prefixing in step 7 does not apply coming from step 3. It may apply coming from step 5. Step 6 can be reached via step 4 or step 5. In the first case (step 4), _directory_ starts with . or .. In this case *curpath* is set to _PWD_/_directory_ in step 6. Were prefixing not done in step 6, it would be done in step 7. Otherwise (end of step 5), *curpath* has not been found by scanning CDPATH, does not begin with . or .. (because of step 4), and does not begin with / (because of step 3). Were prefixing not done in step 6, it would be done in step 7. Thus, in every path leading to step 6 that leads to step 7, the prefixing action done in step 6 could be omitted, since it would be done in step 7. If _PWD_ did not start with a slash, the combined result of steps 6 and 7 would be to prefix it twice with _PWD_. (Such a value of _PWD_ is possible if the application, invoking unspecified behavior, modifies _PWD_.) | ||||
Desired Action | Step 6 should be changed to just: 6. Set curpath to the directory operand. | ||||
Tags | tc1-2008 |
Date Modified | Username | Field | Change |
---|---|---|---|
2010-03-29 07:59 | Konrad_Schwarz | New Issue | |
2010-03-29 07:59 | Konrad_Schwarz | Status | New => Under Review |
2010-03-29 07:59 | Konrad_Schwarz | Assigned To | => ajosey |
2010-03-29 07:59 | Konrad_Schwarz | Name | => Konrad Schwarz |
2010-03-29 07:59 | Konrad_Schwarz | Organization | => Siemens AG |
2010-03-29 07:59 | Konrad_Schwarz | User Reference | => cd-algorithm-simlification |
2010-03-29 07:59 | Konrad_Schwarz | Section | => cd |
2010-03-29 07:59 | Konrad_Schwarz | Page Number | => http://www.opengroup.org/onlinepubs/9699919799/utilities/cd.html |
2010-03-29 07:59 | Konrad_Schwarz | Line Number | => Section DESCRIPTION, Step 6 |
2010-04-15 15:37 | Don Cragun | Interp Status | => --- |
2010-04-15 15:37 | Don Cragun | Status | Under Review => Resolved |
2010-04-15 15:37 | Don Cragun | Resolution | Open => Accepted |
2010-08-27 12:51 | ajosey | Tag Attached: tc1-2008 | |
2013-04-16 13:06 | ajosey | Status | Resolved => Closed |