+ int saved_cwd = 0;
+ struct saved_cwd cwd;
+ char *basename_dir;
+ int first_subdir = 1;
+ char *dirpath;
+
+ /* Temporarily relax umask in case it's overly restrictive. */
+ int oldmask = umask (0);
+
+ /* Make a copy of ARGPATH that we can scribble NULs on. */
+ dirpath = (char *) alloca (strlen (argpath) + 1);
+ strcpy (dirpath, argpath);
+ strip_trailing_slashes (dirpath);