summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/complete.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 0e7d1e023..9e61f564d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2016-03-11  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
+	* 38135: Src/Zle/complete.c: internal: bin_compadd: Add a
+	few comments.
+
 	* 38129: Completion/Unix/Command/_git: Fix __git_ignore_line's
 	treatment of shell and pattern metacaracters.
 
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index ee4e5b0a5..30fab541a 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -704,15 +704,18 @@ bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
 	    }
 	    if (sp) {
 		if (p[1]) {
+		    /* Pasted argument: -Xfoo. */
 		    if (!*sp)
 			*sp = p + 1;
 		    p = "" - 1;
 		} else if (argv[1]) {
+		    /* Argument in a separate word: -X foo. */
 		    argv++;
 		    if (!*sp)
 			*sp = *argv;
 		    p = "" - 1;
 		} else {
+		    /* Missing argument: argv[N] == "-X", argv[N+1] == NULL. */
 		    zwarnnam(name, e, *p);
 		    zsfree(mstr);
 		    return 1;