- savedir_error (path);
- }
- errno = 0;
-
- name_buffer_size = strlen (path) + NAME_FIELD_SIZE;
- name_buffer = xmalloc (name_buffer_size + 2);
- strcpy (name_buffer, path);
- if (! ISSLASH (path[strlen (path) - 1]))
- strcat (name_buffer, "/");
- name_length = strlen (name_buffer);
-
- directory = find_directory (path);
- children = directory ? directory->children : CHANGED_CHILDREN;
-
- accumulator = new_accumulator ();
-
- if (dirp && children != NO_CHILDREN)
- for (entry = dirp;
- (entrylen = strlen (entry)) != 0;
- entry += entrylen + 1)
- {
- if (name_buffer_size <= entrylen + name_length)
- {
- do
- name_buffer_size += NAME_FIELD_SIZE;
- while (name_buffer_size <= entrylen + name_length);
- name_buffer = xrealloc (name_buffer, name_buffer_size + 2);
- }
- strcpy (name_buffer + name_length, entry);
-
- if (excluded_name (name_buffer))
- add_to_accumulator (accumulator, "N", 1);
- else
- {
- struct stat stat_data;
-
- if (deref_stat (dereference_option, name_buffer, &stat_data))
- {
- stat_diag (name_buffer);
- continue;
- }
-
- if (S_ISDIR (stat_data.st_mode))
- {
- bool nfs = NFS_FILE_STAT (stat_data);
-
- if (directory = find_directory (name_buffer), directory)
- {
- /* With NFS, the same file can have two different devices
- if an NFS directory is mounted in multiple locations,
- which is relatively common when automounting.
- To avoid spurious incremental redumping of
- directories, consider all NFS devices as equal,
- relying on the i-node to establish differences. */
-
- if (! (((directory->nfs & nfs)
- || directory->device_number == stat_data.st_dev)
- && directory->inode_number == stat_data.st_ino))
+ if (name_buffer_size <= entrylen + name_length)
+ {
+ do
+ name_buffer_size += NAME_FIELD_SIZE;
+ while (name_buffer_size <= entrylen + name_length);
+ name_buffer = xrealloc (name_buffer, name_buffer_size + 2);
+ }
+ strcpy (name_buffer + name_length, entry);
+
+ if (excluded_name (name_buffer))
+ obstack_1grow (stk, 'N');
+ else
+ {
+ struct stat stat_data;
+
+ if (deref_stat (dereference_option, name_buffer, &stat_data))
+ {
+ stat_diag (name_buffer);
+ continue;
+ }
+
+ if (S_ISDIR (stat_data.st_mode))
+ {
+ bool nfs = NFS_FILE_STAT (stat_data);
+
+ if ((directory = find_directory (name_buffer)) != NULL)
+ {
+ /* With NFS, the same file can have two different devices
+ if an NFS directory is mounted in multiple locations,
+ which is relatively common when automounting.
+ To avoid spurious incremental redumping of
+ directories, consider all NFS devices as equal,
+ relying on the i-node to establish differences. */
+
+ if (! (((directory->nfs & nfs)
+ || directory->device_number == stat_data.st_dev)
+ && directory->inode_number == stat_data.st_ino))