Commit c564873e authored by Ivaylo Ivanov's avatar Ivaylo Ivanov

Fix a bug where the program doesn't read the arguments

parent e94d16e7
#define _GNU_SOURCE // in order for strcasestr to work
#define _GNU_SOURCE ///< in order for strcasestr to work
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
......@@ -15,10 +15,10 @@ int main(int argc, char *argv[]) {
char *ofile = NULL;
char *keyword = NULL;
char *filename = NULL;
int c = getopt(argc, argv, "io:h"); ///< Get the options
int c;
/// Process the options
while(c != -1) {
while((c = getopt(argc, argv, "io:h")) != -1) {
switch(c) {
case 'i':
iflag = 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment