Subject: bug#68227: 29.1; [tramp] adb stopped working (after upgrade from Emacs 28 to 29?)

From: Michael Albinus <[email-masked]>
Date: Fri, 19 Jan 2024 11:31:41 +0100

Maxim Cournoyer <[email-masked]> writes:

> Hi Michael,

Hi Maxim,

> Here's the output:

Thanks.

> 23:36:46.934330 tramp-adb-send-command (6) # ls -1 -d -l / | cat; echo tramp_exit_status $?
> 23:36:46.981460 tramp-wait-for-regexp (6) #
> ls -1 -d -l / | cat; echo tramp_exit_status $?
> ls: Unknown option '-1'. Aborting.
> tramp_exit_status 0
> ///2f285da54fff9cb9e1bff67e9b3cf382#$

Well, Tramp still tries "ls -1". It shouldn't. Could you, please try the
appended patch?

> Thanks,
> Maxim

Best regards, Michael.

diff --git a/lisp/tramp-adb.el b/lisp/tramp-adb.el
index f2c50983..a0377634 100644
--- a/lisp/tramp-adb.el
+++ b/lisp/tramp-adb.el
@@ -348,7 +348,9 @@ arguments to pass to the OPERATION."
       "ls -1 --time-style=long-iso")
      ;; Can't disable coloring explicitly for toybox ls command.  We
      ;; also must force "ls" to print just one column.
-     ((tramp-adb-send-command-and-check vec "toybox") "ls -1")
+     ((tramp-adb-send-command-and-check
+       vec (concat "ls -1 " (tramp-get-remote-null-device vec)))
+      "ls -1")
      ;; On CyanogenMod based system BusyBox is used and "ls" output
      ;; coloring is enabled by default.  So we try to disable it when
      ;; possible.