[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:11:35 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);
oh wait, it also pops the script. Ignore me ;)
--
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#discussion_r501566277
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201008/18f3c734/attachment.html>
More information about the Rpm-maint
mailing list