Better define comment lines for for dict example.
authorMilan Broz <gmazyland@gmail.com>
Fri, 20 Jul 2012 13:36:16 +0000 (15:36 +0200)
committerMilan Broz <gmazyland@gmail.com>
Fri, 20 Jul 2012 13:36:16 +0000 (15:36 +0200)
misc/dict_search/luks_dict.c

index e9a34df..9b9ce81 100644 (file)
@@ -52,9 +52,11 @@ static void check(struct crypt_device *cd, const char *pwd_file, unsigned my_id,
 
                len = strlen(pwd);
 
-               /* lines starting "#" are comments */
-               if (pwd[0] == '#')
+               /* lines starting "#!comment" are comments */
+               if (len >= 9 && !strncmp(pwd, "#!comment", 9)) {
+                       printf("skipping %s\n", pwd);
                        continue;
+               }
 
                /* strip EOL - this is like a input from tty */
                if (len && pwd[len - 1] == '\n') {