Skip to content
Snippets Groups Projects
Commit 20a7bf48 authored by Lev Walkin's avatar Lev Walkin
Browse files

fixed windows version

parent e24403db
No related branches found
No related tags found
No related merge requests found
...@@ -332,6 +332,7 @@ importStandardModules(asn1p_t *asn, const char *skeletons_dir) { ...@@ -332,6 +332,7 @@ importStandardModules(asn1p_t *asn, const char *skeletons_dir) {
asn1p_t *new_asn; asn1p_t *new_asn;
asn1p_module_t *mod; asn1p_module_t *mod;
const char *filename; const char *filename;
char *fullname;
char *target_dir; char *target_dir;
int target_dir_len; int target_dir_len;
int len; int len;
...@@ -365,7 +366,7 @@ importStandardModules(asn1p_t *asn, const char *skeletons_dir) { ...@@ -365,7 +366,7 @@ importStandardModules(asn1p_t *asn, const char *skeletons_dir) {
assert(pattern); assert(pattern);
snprintf(pattern, len, "%s/*.asn1", target_dir); snprintf(pattern, len, "%s/*.asn1", target_dir);
dir = _findfirst(pattern, &c_file); dir = _findfirst(pattern, &c_file);
if(dir != -1L) { if(dir == -1L) {
#else #else
dir = opendir(target_dir); dir = opendir(target_dir);
if(!dir) { if(!dir) {
...@@ -381,8 +382,8 @@ importStandardModules(asn1p_t *asn, const char *skeletons_dir) { ...@@ -381,8 +382,8 @@ importStandardModules(asn1p_t *asn, const char *skeletons_dir) {
filename = c_file.name; filename = c_file.name;
#else #else
while((dp = readdir(dir))) { while((dp = readdir(dir))) {
char *fullname;
filename = dp->d_name; filename = dp->d_name;
#endif
len = strlen(filename); len = strlen(filename);
if(len <= 5 || strcmp(filename + len - 5, ".asn1")) if(len <= 5 || strcmp(filename + len - 5, ".asn1"))
continue; continue;
...@@ -391,7 +392,6 @@ importStandardModules(asn1p_t *asn, const char *skeletons_dir) { ...@@ -391,7 +392,6 @@ importStandardModules(asn1p_t *asn, const char *skeletons_dir) {
if(!fullname) continue; /* Just skip it, no big deal */ if(!fullname) continue; /* Just skip it, no big deal */
snprintf(fullname, len, "%s/%s", target_dir, filename); snprintf(fullname, len, "%s/%s", target_dir, filename);
filename = fullname; filename = fullname;
#endif
new_asn = asn1p_parse_file(filename, A1P_NOFLAGS); new_asn = asn1p_parse_file(filename, A1P_NOFLAGS);
if(new_asn == NULL) { if(new_asn == NULL) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment