← Commit list

76ff0da4d

Glenn L McGrath
Glenn L McGrath
2002-12-23
SOURCE BUG Duration: 20s

Subject

Support the obsolete '+' option

SOURCE BUG

This commit was genuinely broken at the time (not related to our build system): sysdeps/linux/Config.in "fileutils/Config.in" dosyasini kaynak gosteriyor ama bu dosya repoda hic var olmadi (2002-12-05 - 2003-02-15 arasi orijinal yazar hatasi, 3238ea167 ile duzeltildi)

→ Bu hatanin tam hikayesini ve duzeltme diffini gor

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/tail.c+19 -4
@@ -69,12 +69,27 @@ int tail_main(int argc, char **argv)
char *s, *start, *end, buf[BUFSIZ];
int i, opt;
- if (( argc >= 2 ) && ( argv [1][0] == '-' ) && isdigit ( argv [1][1] )) {
- count = atoi ( &argv [1][1] );
- optind = 2;
+ if (argc >= 2) {
+ int line_num;
+ switch (argv[1][0]) {
+ case '+':
+ from_top = 1;
+ /* FALLS THROUGH */
+ case '-':
+ line_num = atoi(&argv[1][1]);
+ if (line_num != 0) {
+ optind = 2;
+ count = line_num;
+ }
+ break;
+ }
}
- while ((opt = getopt(argc, argv, "c:fhn:q:s:v")) > 0) {
+#ifdef CONFIG_FEATURE_FANCY_TAIL
+ while ((opt = getopt(argc, argv, "c:fn:q:s:v")) > 0) {
+#else
+ while ((opt = getopt(argc, argv, "fn:")) > 0) {
+#endif
switch (opt) {
case 'f':
follow = 1;