Hi,

kflag and wflag don't need to be counters; wflag only needs to know if
greater than 0 for its one test case.

Expanded diff context below.

OK?

Thanks,
Okan

Index: ps.c
===================================================================
RCS file: /home/open/cvs/src/bin/ps/ps.c,v
retrieving revision 1.63
diff -u -p -U8 -r1.63 ps.c
--- ps.c        16 Jan 2015 06:39:32 -0000      1.63
+++ ps.c        9 Apr 2015 18:41:13 -0000
@@ -153,17 +153,17 @@ main(int argc, char *argv[])
                        prtheader = ws.ws_row > 5 ? ws.ws_row : 22;
                        break;
                case 'j':
                        parsefmt(jfmt);
                        fmt = 1;
                        jfmt[0] = '\0';
                        break;
                case 'k':
-                       kflag++;
+                       kflag = 1;
                        break;
                case 'L':
                        showkey();
                        exit(0);
                case 'l':
                        parsefmt(lfmt);
                        fmt = 1;
                        lfmt[0] = '\0';
@@ -243,17 +243,17 @@ main(int argc, char *argv[])
                case 'W':
                        swapf = optarg;
                        break;
                case 'w':
                        if (wflag)
                                termwidth = UNLIMITED;
                        else if (termwidth < 131)
                                termwidth = 131;
-                       wflag++;
+                       wflag = 1;
                        break;
                case 'x':
                        xflg = 1;
                        break;
                default:
                        usage();
                }
        argc -= optind;

Reply via email to