Browse Source

(mc_realpath): cleanup cppcheck warning.

Cleanup following cppcheck warnings:

[lib/utilunix.c:1109]: (style) Unused variable: link_path.
[lib/utilunix.c:1113]: (style) Variable 'readlinks' is assigned a value that is never used.
[lib/utilunix.c:1114]: (style) Unused variable: n.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Andreas Mohr 9 years ago
parent
commit
1c2060c28f
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/utilunix.c

+ 3 - 1
lib/utilunix.c

@@ -1106,12 +1106,14 @@ char *
 mc_realpath (const char *path, char *resolved_path)
 mc_realpath (const char *path, char *resolved_path)
 {
 {
     char copy_path[PATH_MAX];
     char copy_path[PATH_MAX];
-    char link_path[PATH_MAX];
     char got_path[PATH_MAX];
     char got_path[PATH_MAX];
     char *new_path = got_path;
     char *new_path = got_path;
     char *max_path;
     char *max_path;
+#ifdef S_IFLNK
+    char link_path[PATH_MAX];
     int readlinks = 0;
     int readlinks = 0;
     int n;
     int n;
+#endif /* S_IFLNK */
 
 
     /* Make a copy of the source path since we may need to modify it. */
     /* Make a copy of the source path since we may need to modify it. */
     if (strlen (path) >= PATH_MAX - 2)
     if (strlen (path) >= PATH_MAX - 2)