Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Allow setting $0 when POSIX_ARGZERO is not set
- X-seq: zsh-workers 35476
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: Allow setting $0 when POSIX_ARGZERO is not set
- Date: Tue, 16 Jun 2015 01:44:39 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=xZReaaX4y1EYnpbsbV05lE1kzX5myocWKEXw28L05YU=; b=uxD3DieTFqSLYmqcIa8+hs4ZlKFeFXN/msX0dByZnQEpTQJy3UNasRs8+Zu/d6D6NC Caji6f/OhwQon1GhFCcRxQU0LEq5SujXvWifgFKJt1uQHJ02iSLwmpv2DBIlS6kWaN3E Bxx109ZPux4uZTXGdXvJ+viMEcsLN6op0cOA6gLshe8zKmMTp/RVOtaO9Kzhw0sx8TVT 24WiLcXiS3o16xAV1DLr7V8jBl4NBlp7fZtwAmT7vzU6+KJEMk/pb9i+6aob/BH37QbX fpd8t5jC7fc3DgTEWHQy8cm/7jl39wUd36Bnd9FbgEtee0G7ckoWHyMVwCbKZrK8cH8H O+pA==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
I don't think this should hurt anything.
---
Src/params.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/Src/params.c b/Src/params.c
index 98541a6..3b75735 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -196,7 +196,7 @@ static const struct gsu_integer ttyidle_gsu =
{ ttyidlegetfn, nullintsetfn, stdunsetfn };
static const struct gsu_scalar argzero_gsu =
-{ argzerogetfn, nullstrsetfn, nullunsetfn };
+{ argzerogetfn, argzerosetfn, nullunsetfn };
static const struct gsu_scalar username_gsu =
{ usernamegetfn, usernamesetfn, stdunsetfn };
static const struct gsu_scalar dash_gsu =
@@ -4044,6 +4044,21 @@ lcsetfn(Param pm, char *x)
}
#endif /* USE_LOCALE */
+/* Function to set value for special parameter `0' */
+
+/**/
+static void
+argzerosetfn(UNUSED(Param pm), char *x)
+{
+ if (x) {
+ if (!isset(POSIXARGZERO)) {
+ zsfree(argzero);
+ argzero = ztrdup(x);
+ }
+ zsfree(x);
+ }
+}
+
/* Function to get value for special parameter `0' */
/**/
--
2.4.0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author