summaryrefslogtreecommitdiffstats
path: root/src/lid.c
diff options
context:
space:
mode:
authorGreg McGary <greg@mcgary.org>1999-04-08 09:53:10 +0000
committerGreg McGary <greg@mcgary.org>1999-04-08 09:53:10 +0000
commit797dd02870ed606e1503e0a24b2d1e4e4068244b (patch)
tree96e9422c8e681c9d6e734278febc2ce2d2ac690b /src/lid.c
parent9e5bd0c4df77dff6f0a914375b82ff100bb55cab (diff)
downloadidutils-797dd02870ed606e1503e0a24b2d1e4e4068244b.tar.gz
idutils-797dd02870ed606e1503e0a24b2d1e4e4068244b.tar.bz2
idutils-797dd02870ed606e1503e0a24b2d1e4e4068244b.zip
* src/lid.c (limits.h): Include earlier to avoid RE_DUP_MAX
conflict. [From Erick.Branderhorst@asml.nl] (search_flinkv): Bash terminating newline. [From marc@snafu.org] * lisp/elisp-comp: Import more recent version from automake. * libidu/scanners.c (SCAN_CPP_DIRECTIVE): Tolerate leading whitespace before first '#' [From rodneybrown@pmsc.com] (get_token_asm, get_token_c): Move some common leading context into SCAN_CPP_DIRECTIVE.
Diffstat (limited to 'src/lid.c')
-rw-r--r--src/lid.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lid.c b/src/lid.c
index 73ff727..04ef18b 100644
--- a/src/lid.c
+++ b/src/lid.c
@@ -26,6 +26,9 @@
#include <sys/wait.h>
#include <assert.h>
#include <getopt.h>
+#if HAVE_LIMITS_H
+# include <limits.h>
+#endif
#include <regex.h>
#include "xstring.h"
#include "xunistd.h"
@@ -36,9 +39,6 @@
#include "error.h"
#include "pathmax.h"
#include "xalloca.h"
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
typedef void (*report_func_t) __P((char const *name, struct file_link **flinkv));
typedef int (*query_func_t) __P((char const *arg, report_func_t));
@@ -758,9 +758,13 @@ search_flinkv (struct file_link **flinkv)
char pattern[BUFSIZ];
unsigned int count;
char *file_name = ALLOCA (char, PATH_MAX);
+ char *eol;
if (fgets (pattern, sizeof (pattern), stdin) == 0)
return -1;
+ eol = strchr(pattern, '\n');
+ if (eol)
+ *eol = 0;
for (count = 0; *flinkv; count++, flinkv++)
{