Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
39219543
Commit
39219543
authored
Jan 09, 2005
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 09, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixed infinite loop bug.
- Code cleanup.
parent
63afcfeb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
26 deletions
+37
-26
preproc.c
libs/wpp/preproc.c
+37
-26
No files found.
libs/wpp/preproc.c
View file @
39219543
...
...
@@ -103,10 +103,12 @@ void *pp_xrealloc(void *p, size_t size)
char
*
pp_xstrdup
(
const
char
*
str
)
{
char
*
s
;
int
len
;
assert
(
str
!=
NULL
);
s
=
pp_xmalloc
(
strlen
(
str
)
+
1
);
return
strcpy
(
s
,
str
);
len
=
strlen
(
str
)
+
1
;
s
=
pp_xmalloc
(
len
);
return
memcpy
(
s
,
str
,
len
);
}
/* Don't comment on the hash, its primitive but functional... */
...
...
@@ -328,25 +330,25 @@ void wpp_add_include_path(const char *path)
tok
=
strtok
(
cpy
,
INCLUDESEPARATOR
);
while
(
tok
)
{
char
*
dir
;
char
*
cptr
;
if
(
strlen
(
tok
)
==
0
)
continue
;
dir
=
pp_xstrdup
(
tok
);
for
(
cptr
=
dir
;
*
cptr
;
cptr
++
)
{
/* Convert to forward slash */
if
(
*
cptr
==
'\\'
)
*
cptr
=
'/'
;
if
(
*
tok
)
{
char
*
dir
;
char
*
cptr
;
dir
=
pp_xstrdup
(
tok
);
for
(
cptr
=
dir
;
*
cptr
;
cptr
++
)
{
/* Convert to forward slash */
if
(
*
cptr
==
'\\'
)
*
cptr
=
'/'
;
}
/* Kill eventual trailing '/' */
if
(
*
(
cptr
=
dir
+
strlen
(
dir
)
-
1
)
==
'/'
)
*
cptr
=
'\0'
;
/* Add to list */
nincludepath
++
;
includepath
=
pp_xrealloc
(
includepath
,
nincludepath
*
sizeof
(
*
includepath
));
includepath
[
nincludepath
-
1
]
=
dir
;
}
/* Kill eventual trailing '/' */
if
(
*
(
cptr
=
dir
+
strlen
(
dir
)
-
1
)
==
'/'
)
*
cptr
=
'\0'
;
/* Add to list */
nincludepath
++
;
includepath
=
pp_xrealloc
(
includepath
,
nincludepath
*
sizeof
(
*
includepath
));
includepath
[
nincludepath
-
1
]
=
dir
;
tok
=
strtok
(
NULL
,
INCLUDESEPARATOR
);
}
free
(
cpy
);
...
...
@@ -354,19 +356,28 @@ void wpp_add_include_path(const char *path)
char
*
wpp_find_include
(
const
char
*
name
,
int
search
)
{
char
*
cpy
=
pp_xstrdup
(
name
)
;
char
*
cpy
;
char
*
cptr
;
const
char
*
ccptr
;
int
i
,
fd
;
for
(
cptr
=
cpy
;
*
cptr
;
cptr
++
)
cpy
=
pp_xmalloc
(
strlen
(
name
)
+
1
);
cptr
=
cpy
;
for
(
ccptr
=
name
;
*
ccptr
;
ccptr
++
)
{
/* kill double backslash */
if
(
*
cptr
==
'\\'
&&
*
(
cptr
+
1
)
==
'\\'
)
memmove
(
cptr
,
cptr
+
1
,
strlen
(
cptr
));
/* Convert to forward slash */
if
(
*
cptr
==
'\\'
)
if
(
*
ccptr
==
'\\'
)
{
/* kill double backslash */
if
(
ccptr
[
1
]
==
'\\'
)
ccptr
++
;
*
cptr
=
'/'
;
}
else
{
*
cptr
=
*
ccptr
;
}
cptr
++
;
}
*
cptr
=
'\0'
;
if
(
search
)
{
...
...
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