}
closeproc (ptp);
*num = matches;
+
+ if ((!matches) && (!opt_full) && (strlen(opt_pattern) > 15))
+ xwarnx(_("pattern that searches for process name longer than 15 characters will result in zero matches\n"
+ "Try `%s -f' option to match against the complete command line."),
+ program_invocation_short_name);
return list;
}
}
if (argc - optind == 1)
- {
opt_pattern = argv[optind];
- if ((!opt_full) && (strlen(opt_pattern) > 15))
- xwarnx(_("pattern that contains program name longer than 15 characters will result in zero matches\n"
- "Try `%s -f' option for thorough search."),
- program_invocation_short_name);
- }
-
else if (argc - optind > 1)
xerrx(EXIT_USAGE, _("only one pattern can be provided\n"
"Try `%s --help' for more information."),
spawn $pgrep -x $testproc_trim
expect_blank $test
-set test "pgrep with long match gives warning"
+set test "pgrep with long non-matching pattern gives warning"
spawn $pgrep gnome-session-bi
-expect_pass "$test" "pattern that contains program name longer than 15 characters will result in zero matches"
+expect_pass "$test" "pattern that searches for process name longer than 15 characters will result in zero matches"
# Cleanup
kill_testproc