Merge branch 'fix_getopt' into 'master'

Allow NULL as longindex parameter on getopt_long

See merge request redox-os/relibc!815
This commit is contained in:
Jeremy Soller
2025-12-17 12:02:10 -07:00
+3 -1
View File
@@ -86,7 +86,9 @@ pub unsafe extern "C" fn getopt_long(
if unsafe { string::strncmp(current_arg, opt.name, end as size_t) == 0 } {
unsafe {
optind += 1;
*longindex = i as c_int;
if !longindex.is_null() {
*longindex = i as c_int;
}
}
if opt.has_arg == optional_argument {