Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Allow '=' aliases to be used with -L



Special case '=' aliases so that they can be output correctly
by -L and be used in startup scripts.

Signed-off-by: Joey Pabalinas <joeypabalinas@xxxxxxxxx>

 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/Src/hashtable.c b/Src/hashtable.c
index b7baa314220509240d..62f8e9df3b99b6d5e2 100644
--- a/Src/hashtable.c
+++ b/Src/hashtable.c
@@ -1303,11 +1303,17 @@ printaliasnode(HashNode hn, int printflags)
     }
 
     if (printflags & PRINT_LIST) {
-	/* Fast fail on unrepresentable values. */
+	/*
+	 * '=' aliases need to be special
+	 * cased with direct alias table
+	 * assignment (`aliases[=]=...`).
+	 */
 	if (strchr(a->node.nam, '=')) {
-	    zwarn("invalid alias '%s' encountered while printing aliases", 
-		  a->node.nam);
-	    /* ### TODO: Return an error status to the C caller */
+	    printf("aliases[=]");
+	    putchar('=');
+	    quotedzputs(a->text, stdout);
+
+	    putchar('\n');
 	    return;
 	}
 
-- 
2.16.2

Attachment: signature.asc
Description: PGP signature



Messages sorted by: Reverse Date, Date, Thread, Author