Commit 55c760dc 55c760dc7d7c972cd216d43a095c0291ed7304a5 by Sergey Poznyakoff

(_scan): Test for existence of the folder even if --fast was given. Exit with co…

…de 1 if the folder does not exist.
1 parent a1ebdad4
Showing 1 changed file with 16 additions and 18 deletions
...@@ -304,20 +304,6 @@ _scan (const char *name, int depth) ...@@ -304,20 +304,6 @@ _scan (const char *name, int depth)
304 struct stat st; 304 struct stat st;
305 size_t uid; 305 size_t uid;
306 306
307 if (!recurse)
308 {
309 if (fast_mode && depth > 0)
310 {
311 memset (&info, 0, sizeof (info));
312 info.name = strdup (name);
313 install_folder_info (name, &info);
314 return;
315 }
316
317 if (depth > 1)
318 return;
319 }
320
321 dir = opendir (name); 307 dir = opendir (name);
322 308
323 if (!dir && errno == ENOENT) 309 if (!dir && errno == ENOENT)
...@@ -332,10 +318,7 @@ _scan (const char *name, int depth) ...@@ -332,10 +318,7 @@ _scan (const char *name, int depth)
332 dir = opendir (name); 318 dir = opendir (name);
333 } 319 }
334 else 320 else
335 { 321 exit (1);
336 push_folder = 0;
337 return;
338 }
339 } 322 }
340 323
341 if (!dir) 324 if (!dir)
...@@ -344,6 +327,21 @@ _scan (const char *name, int depth) ...@@ -344,6 +327,21 @@ _scan (const char *name, int depth)
344 return; 327 return;
345 } 328 }
346 329
330 if (!recurse)
331 {
332 closedir (dir);
333 if (fast_mode && depth > 0)
334 {
335 memset (&info, 0, sizeof (info));
336 info.name = strdup (name);
337 install_folder_info (name, &info);
338 return;
339 }
340
341 if (depth > 1)
342 return;
343 }
344
347 memset (&info, 0, sizeof (info)); 345 memset (&info, 0, sizeof (info));
348 info.name = strdup (name); 346 info.name = strdup (name);
349 while ((entry = readdir (dir))) 347 while ((entry = readdir (dir)))
......