[Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

Michael Schroeder notifications at github.com
Thu Oct 8 09:03:27 UTC 2020


@mlschroe commented on this pull request.



> +    lua_newtable(L);
+    if (opts) {
+	int c, argc = argvCount(args);
+
+/* glibc uses optind 0 for (re)initializing internal structures, sigh */
+#ifdef __GLIBC__
+	optind = 0;
+#else
+	optind = 1;
+#endif
+	while ((c = getopt(argc, args, opts)) != -1) {
+	    char key[2] = { c, '\0' };
+	    if (c == '?' || strchr(opts, c) == NULL) {
+		rpmlog(RPMLOG_ERR, _("Unknown option %c in %s(%s)\n"),
+			(char)optopt, name, opts);
+		lua_pop(L, 2);

Shouldn't that pop just one element?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1383#pullrequestreview-504573607
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201008/0d4c5a45/attachment.html>


More information about the Rpm-maint mailing list