Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
b66d6e2d
Commit
b66d6e2d
authored
Jun 25, 2013
by
Alexander Lunev
Committed by
Dick Hollenbeck
Jun 25, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcad2kicadpcb: check for file format
parent
e513380a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
s_expr_loader.cpp
pcbnew/pcad2kicadpcb_plugin/s_expr_loader.cpp
+10
-0
No files found.
pcbnew/pcad2kicadpcb_plugin/s_expr_loader.cpp
View file @
b66d6e2d
...
...
@@ -34,9 +34,11 @@
namespace
PCAD2KICAD
{
static
KEYWORD
empty_keywords
[
1
]
=
{};
static
const
char
ACCEL_ASCII_KEYWORD
[]
=
"ACCEL_ASCII"
;
void
LoadInputFile
(
wxString
aFileName
,
wxXmlDocument
*
aXmlDoc
)
{
char
line
[
sizeof
(
ACCEL_ASCII_KEYWORD
)];
int
tok
;
XNODE
*
iNode
=
NULL
,
*
cNode
=
NULL
;
wxString
str
,
propValue
,
content
;
...
...
@@ -47,6 +49,14 @@ void LoadInputFile( wxString aFileName, wxXmlDocument* aXmlDoc )
if
(
!
fp
)
THROW_IO_ERROR
(
wxT
(
"Unable to open file: "
)
+
aFileName
);
// check file format
if
(
!
fgets
(
line
,
sizeof
(
line
),
fp
)
||
strcmp
(
line
,
ACCEL_ASCII_KEYWORD
)
)
THROW_IO_ERROR
(
"Unknown file type"
);
// rewind the file
fseek
(
fp
,
0
,
SEEK_SET
);
// lexer now owns fp, will close on exception or return
DSNLEXER
lexer
(
empty_keywords
,
0
,
fp
,
aFileName
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment