The last patch has missied for no-args. The attached patch will fix the issue.
Thanks, Halesh n 7/3/08, Halesh S <[EMAIL PROTECTED]> wrote: > Test 1: > ---------- > $ finger <some-user> > finger: 1: no such user. > $echo $? > 0 > > Test 2: > ---------- > $pinky <some-user> > Login Name TTY Idle When Where > $echo $? > 0 > > Verified in coreutils-6.9 > > Patch to fix the issue in pinky(1) > ============================ > --- old.src/pinky.c 2008-07-03 12:48:49.000000000 +0530 > +++ src/pinky.c 2008-07-03 12:48:18.000000000 +0530 > @@ -438,6 +438,7 @@ > scan_entries (size_t n, const STRUCT_UTMP *utmp_buf, > const int argc_names, char *const argv_names[]) > { > + int not_found_flg = 1; > if (hard_locale (LC_TIME)) > { > time_format = "%Y-%m-%d %H:%M"; > @@ -464,6 +465,7 @@ > if (strncmp (UT_USER (utmp_buf), argv_names[i], UT_USER_SIZE) > == 0) > { > + not_found_flg = 0; > print_entry (utmp_buf); > break; > } > @@ -473,6 +475,12 @@ > } > utmp_buf++; > } > + if (not_found_flg) > + { > + fprintf (stderr, _("no user found.\n"), > + program_name); > + exit(1); > + } > } > > /* Display a list of who is on the system, according to utmp file FILENAME. > */ > =================================== > > After applaying patch > > Test 2 > --------- > $pinky <some-user> > Login Name TTY Idle When Where > no user found. > $echo $? > 1 > > Thanks, > > Halesh >
pinky.c.patch
Description: Binary data
_______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils