]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - misc-utils/look.c
misc: add static keyword to where needed [smatch scan]
[thirdparty/util-linux.git] / misc-utils / look.c
index ae0d576ddc6e73a1bd724a311f157b82fed2192e..3f785a727fcd2b696e9ab1ce9861cd3c12847f46 100644 (file)
 #define        GREATER         1
 #define        LESS            (-1)
 
-int dflag, fflag;
+static int dflag, fflag;
 /* uglified the source a bit with globals, so that we only need
    to allocate comparbuf once */
-int stringlen;
-char *string;
-char *comparbuf;
+static int stringlen;
+static char *string;
+static char *comparbuf;
 
 static char *binary_search (char *, char *);
 static int compare (char *, char *);
@@ -164,7 +164,7 @@ main(int argc, char *argv[])
        return look(front, back);
 }
 
-int
+static int
 look(char *front, char *back)
 {
        int ch;
@@ -232,7 +232,7 @@ look(char *front, char *back)
 #define        SKIP_PAST_NEWLINE(p, back) \
        while (p < back && *p++ != '\n')
 
-char *
+static char *
 binary_search(char *front, char *back)
 {
        char *p;
@@ -266,7 +266,7 @@ binary_search(char *front, char *back)
  *     o front points at the first character in a line.
  *     o front is before or at the first line to be printed.
  */
-char *
+static char *
 linear_search(char *front, char *back)
 {
        while (front < back) {
@@ -286,7 +286,7 @@ linear_search(char *front, char *back)
 /*
  * Print as many lines as match string, starting at front.
  */
-void
+static void
 print_from(char *front, char *back)
 {
        int eol;
@@ -321,7 +321,7 @@ print_from(char *front, char *back)
  * We use strcasecmp etc, since it knows how to ignore case also
  * in other locales.
  */
-int
+static int
 compare(char *s2, char *s2end) {
        int i;
        char *p;