From 6eed7c952dbb0e7151723881dc26e955b9d9595d Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 29 May 2019 15:18:50 -0600
Subject: wcmd: Display reparse point type in directory listings.

Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
 programs/cmd/directory.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/programs/cmd/directory.c b/programs/cmd/directory.c
index 2d35f8eb1d1..5b7416ce72a 100644
--- a/programs/cmd/directory.c
+++ b/programs/cmd/directory.c
@@ -400,6 +400,32 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
             WCMD_output(L"%1!*s!", cur_width - tmp_width, nullW);
         }
 
+      } else if (fd[i].dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+        if (!bare) {
+           const WCHAR *type;
+
+           switch(fd[i].dwReserved0) {
+           case IO_REPARSE_TAG_MOUNT_POINT:
+              type = L"<JUNCTION>";
+              break;
+           case IO_REPARSE_TAG_SYMLINK:
+           default:
+              type = (fd[i].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? L"<SYMLINKD>" : L"<SYMLINK>";
+              break;
+           }
+           WCMD_output (L"%1!10s!  %2!8s!  %3!-14s!", datestring, timestring, type);
+           if (shortname) WCMD_output (fmt2, fd[i].cAlternateFileName);
+           if (usernames) WCMD_output (fmt3, username);
+           WCMD_output(fmt4,fd[i].cFileName);
+        } else {
+           if (!((lstrcmpW(fd[i].cFileName, dotW) == 0) ||
+                 (lstrcmpW(fd[i].cFileName, dotdotW) == 0))) {
+              WCMD_output (fmt5, recurse?inputparms->dirName:nullW, fd[i].cFileName);
+           } else {
+              addNewLine = FALSE;
+           }
+        }
+
       } else if (fd[i].dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
         dir_count++;
 
-- 
2.17.1

