File mc-extd-xdg.patch of Package mc

---
 misc/ext.d/archive.sh |    2 +-
 misc/ext.d/doc.sh.in  |    2 +-
 misc/ext.d/image.sh   |    2 +-
 misc/ext.d/misc.sh.in |    2 +-
 misc/ext.d/package.sh |    2 +-
 misc/ext.d/sound.sh   |    2 +-
 misc/ext.d/text.sh.in |    2 +-
 misc/ext.d/video.sh   |    2 +-
 misc/ext.d/web.sh     |    2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

Index: mc-4.8.33/misc/ext.d/archive.sh
===================================================================
--- mc-4.8.33.orig/misc/ext.d/archive.sh
+++ mc-4.8.33/misc/ext.d/archive.sh
@@ -210,7 +210,7 @@ view)
     do_view_action "${filetype}"
     ;;
 open)
-    ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
+    test -n "$DISPLAY" && ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
         do_open_action "${filetype}" "${pager}"
     ;;
 *)
Index: mc-4.8.33/misc/ext.d/doc.sh.in
===================================================================
--- mc-4.8.33.orig/misc/ext.d/doc.sh.in
+++ mc-4.8.33/misc/ext.d/doc.sh.in
@@ -210,7 +210,7 @@ view)
     do_view_action "${filetype}"
     ;;
 open)
-    ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
+    test -n "$DISPLAY" && ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
         do_open_action "${filetype}"
     ;;
 *)
Index: mc-4.8.33/misc/ext.d/image.sh
===================================================================
--- mc-4.8.33.orig/misc/ext.d/image.sh
+++ mc-4.8.33/misc/ext.d/image.sh
@@ -72,7 +72,7 @@ view)
     do_view_action "${filetype}"
     ;;
 open)
-    ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
+    test -n "$DISPLAY" && ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
         do_open_action "${filetype}"
     ;;
 *)
Index: mc-4.8.33/misc/ext.d/misc.sh.in
===================================================================
--- mc-4.8.33.orig/misc/ext.d/misc.sh.in
+++ mc-4.8.33/misc/ext.d/misc.sh.in
@@ -96,7 +96,7 @@ view)
     do_view_action "${filetype}"
     ;;
 open)
-    ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
+    test -n "$DISPLAY" && ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
         do_open_action "${filetype}"
     ;;
 *)
Index: mc-4.8.33/misc/ext.d/package.sh
===================================================================
--- mc-4.8.33.orig/misc/ext.d/package.sh
+++ mc-4.8.33/misc/ext.d/package.sh
@@ -51,7 +51,7 @@ view)
     do_view_action "${filetype}"
     ;;
 open)
-    ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
+    test -n "$DISPLAY" && ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
         do_open_action "${filetype}"
     ;;
 *)
Index: mc-4.8.33/misc/ext.d/sound.sh
===================================================================
--- mc-4.8.33.orig/misc/ext.d/sound.sh
+++ mc-4.8.33/misc/ext.d/sound.sh
@@ -105,7 +105,7 @@ view)
     do_view_action "${filetype}"
     ;;
 open)
-    ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
+    test -n "$DISPLAY" && ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
         do_open_action "${filetype}"
     ;;
 *)
Index: mc-4.8.33/misc/ext.d/text.sh.in
===================================================================
--- mc-4.8.33.orig/misc/ext.d/text.sh.in
+++ mc-4.8.33/misc/ext.d/text.sh.in
@@ -147,7 +147,7 @@ view)
     do_view_action "${filetype}"
     ;;
 open)
-    ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
+    test -n "$DISPLAY" && ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
         do_open_action "${filetype}" "${pager}"
     ;;
 *)
Index: mc-4.8.33/misc/ext.d/video.sh
===================================================================
--- mc-4.8.33.orig/misc/ext.d/video.sh
+++ mc-4.8.33/misc/ext.d/video.sh
@@ -50,7 +50,7 @@ view)
     do_view_action "${filetype}"
     ;;
 open)
-    ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
+    test -n "$DISPLAY" && ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
         do_open_action "${filetype}"
     ;;
 *)
Index: mc-4.8.33/misc/ext.d/web.sh
===================================================================
--- mc-4.8.33.orig/misc/ext.d/web.sh
+++ mc-4.8.33/misc/ext.d/web.sh
@@ -52,7 +52,7 @@ view)
     do_view_action "${filetype}"
     ;;
 open)
-    ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
+    test -n "$DISPLAY" && ("${MC_XDG_OPEN}" "${MC_EXT_FILENAME}" >/dev/null 2>&1) || \
         do_open_action "${filetype}"
     ;;
 *)
openSUSE Build Service is sponsored by