~eadwardus/ecore

24489a1f4f1f5272e4ee5dfa525b742c3d754d12 — Eduardo Francisco 3 months ago c592090
Fix std_getopt misuse
2 files changed, 5 insertions(+), 4 deletions(-)

M src/chmod.c
M src/chown.c
M src/chmod.c => src/chmod.c +4 -3
@@ 25,7 25,7 @@ main(int argc, char **argv)

	Rflag = 0;

	switch (c_std_getopt(argmain, argc, argv, "RXrstxw")) {
	while (c_std_getopt(argmain, argc, argv, "RXrstxw")) {
		switch (argmain->opt) {
		case 'R':
			Rflag = 1;


@@ 36,15 36,16 @@ main(int argc, char **argv)
		case 't':
		case 'x':
		case 'w':
			--argv[0];
			--argmain->idx;
			goto done;
		default:
			usage();
		}
	}
done:
	argc -= argmain->idx;
	argv += argmain->idx;
done:

	if (argc < 2)
		usage();


M src/chown.c => src/chown.c +1 -1
@@ 33,7 33,7 @@ main(int argc, char **argv)
	opts = 0;
	ropts = 0;

	switch (c_std_getopt(argmain, argc, argv, "HLPRh")) {
	while (c_std_getopt(argmain, argc, argv, "HLPRh")) {
		switch (argmain->opt) {
		case 'H':
			opts |= C_FSCOM;