- wd[wd_count].name = dir;
- /* if the given name is an absolute path, then use that path
- to represent this working directory; otherwise, construct
- a path based on the previous -C option's absolute path */
- if (IS_ABSOLUTE_FILE_NAME (wd[wd_count].name))
- wd[wd_count].abspath = xstrdup (wd[wd_count].name);
- else
+
+ /* If the given name is absolute, use it to represent this directory;
+ otherwise, construct a name based on the previous -C option. */
+ if (IS_ABSOLUTE_FILE_NAME (dir))
+ absdir = xstrdup (dir);
+ else if (wd[wd_count - 1].abspath)