Fix debug messages, show scanned path.
authorGustavo Sverzut Barbieri <barbieri@gmail.com>
Fri, 15 Feb 2008 18:37:56 +0000 (18:37 +0000)
committerGustavo Sverzut Barbieri <barbieri@gmail.com>
Fri, 15 Feb 2008 18:37:56 +0000 (18:37 +0000)
git-svn-id: https://garage.maemo.org/svn/lms/lightmediascanner@79 fe9ffe84-2fc0-424c-a0c2-0ec162e4acf5

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;
             }