-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extended the keyspace to include any character except '/'. Resulting …
…file format is version 3.0. There are no visible changes in the interface, when a file is written, it start as version 2 and is changed to version 3 only if a non-conformant key is written. Removed aff_name_check() from the interface, added aff_name_check[23](). Aslo added aff_reader_namecheck(). Added support for python 3 git-svn-id: file:///Users/avp/tmp/svn.20121212/LHPC/aff/trunk@2246 65d2813f-f11f-0410-b17b-8647a28db151
- Loading branch information
avp
committed
Aug 9, 2011
1 parent
4d5617a
commit 15ab460
Showing
11 changed files
with
1,104 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,46 @@ | ||
#include <stdint.h> | ||
#include <string.h> | ||
#include <ctype.h> | ||
#include "aff.h" | ||
#include "md5.h" | ||
#include "aff-i.h" | ||
|
||
int | ||
aff_name_check(const char *name) | ||
aff_name_check3(const char *name) | ||
{ | ||
if (name == 0 || *name == 0) | ||
return 1; | ||
for (;*name; name++) { | ||
if (*name == '/') | ||
return 1; | ||
} | ||
return 0; | ||
} | ||
|
||
int | ||
aff_name_check2(const char *name) | ||
{ | ||
int ch; | ||
if (name == 0 || *name == 0) | ||
return 1; | ||
return 1; | ||
ch = name[0]; | ||
if (!(isalpha(ch) || strchr(":_", ch))) | ||
return 1; | ||
return 1; | ||
for (;*++name;) { | ||
ch = *name; | ||
if (!(isalnum(ch) || strchr(":_-.", ch))) | ||
return 1; | ||
ch = *name; | ||
if (!(isalnum(ch) || strchr(":_-.", ch))) | ||
return 1; | ||
} | ||
return 0; | ||
} | ||
|
||
int aff_reader_namecheck(struct AffReader_s *aff, const char *name) | ||
{ | ||
switch (aff->version) { | ||
case 2: | ||
return aff_name_check2(name); | ||
case 3: | ||
return aff_name_check3(name); | ||
default: | ||
return 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.