Fix debug messages, show scanned path.
authorbarbieri <barbieri@gmail.com>
Fri, 15 Feb 2008 18:37:56 +0000 (18:37 +0000)
committerbarbieri <barbieri@gmail.com>
Fri, 15 Feb 2008 18:37:56 +0000 (18:37 +0000)
lightmediascanner/src/lib/lightmediascanner_process.c

index 83b5894..80a1cbd 100644 (file)
@@ -785,19 +785,19 @@ _process_dir(struct pinfo *pinfo, int base, char *path, const char *name)
             continue;
         if (de->d_type == DT_REG) {
             if (_process_file(pinfo, new_len, path, de->d_name) < 0) {
-                path[new_len - 1] = '\0';
                 fprintf(stderr,
                         "ERROR: unrecoverable error parsing file, "
                         "exit \"%s\".\n", path);
+                path[new_len - 1] = '\0';
                 r = -4;
                 goto end;
             }
         } else if (de->d_type == DT_DIR || de->d_type == DT_UNKNOWN) {
             if (_process_dir(pinfo, new_len, path, de->d_name) < 0) {
-                path[new_len - 1] = '\0';
                 fprintf(stderr,
                         "ERROR: unrecoverable error parsing dir, "
                         "exit \"%s\".\n", path);
+                path[new_len - 1] = '\0';
                 r = -5;
                 goto end;
             }