Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] fix _gdb shift error
- X-seq: zsh-workers 55212
- From: tiandic <2323748675@xxxxxx>
- To: zsh-workers@xxxxxxx
- Cc: tiandic <2323748675@xxxxxx>
- Subject: [PATCH] fix _gdb shift error
- Date: Mon, 12 Oct 2026 13:28:54 +0800
- Archived-at: <https://zsh.org/workers/55212>
- List-id: <zsh-workers.zsh.org>
This error is triggered when using `gdb -cd <TAB>`
---
Completion/Unix/Command/_gdb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Completion/Unix/Command/_gdb b/Completion/Unix/Command/_gdb
index 6bdd55946..7470e6102 100644
--- a/Completion/Unix/Command/_gdb
+++ b/Completion/Unix/Command/_gdb
@@ -43,7 +43,7 @@ else
w=( "${(@)words[2,CURRENT-1]}" )
while [[ "$w[1]" = -* ]]; do
[[ "$w[1]" = -(cd|se|tty|[decsxb]) ]] && shift 1 w
- shift 1 w
+ (( $#w )) && shift 1 w
done
if [[ $#w -gt 1 ]]; then
--
2.56.0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author