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
e8754b8e
Commit
e8754b8e
authored
Sep 21, 2008
by
Erik Inge Bolsø
Committed by
Alexandre Julliard
Sep 23, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Fix PROFILE_Load to handle mac line endings.
parent
40145952
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
11 deletions
+22
-11
profile.c
dlls/kernel32/profile.c
+1
-0
profile.c
dlls/kernel32/tests/profile.c
+21
-11
No files found.
dlls/kernel32/profile.c
View file @
e8754b8e
...
...
@@ -405,6 +405,7 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding)
{
szLineStart
=
next_line
;
next_line
=
memchrW
(
szLineStart
,
'\n'
,
szEnd
-
szLineStart
);
if
(
!
next_line
)
next_line
=
memchrW
(
szLineStart
,
'\r'
,
szEnd
-
szLineStart
);
if
(
!
next_line
)
next_line
=
szEnd
;
else
next_line
++
;
szLineEnd
=
next_line
;
...
...
dlls/kernel32/tests/profile.c
View file @
e8754b8e
...
...
@@ -428,7 +428,7 @@ static BOOL emptystr_ok(CHAR emptystr[MAX_PATH])
return
TRUE
;
}
static
void
test_GetPrivateProfileString
(
void
)
static
void
test_GetPrivateProfileString
(
const
char
*
content
,
const
char
*
descript
)
{
DWORD
ret
;
CHAR
buf
[
MAX_PATH
];
...
...
@@ -441,15 +441,10 @@ static void test_GetPrivateProfileString(void)
LPSTR
tempfile
;
static
const
char
filename
[]
=
".
\\
winetest.ini"
;
static
const
char
content
[]
=
"[section1]
\r\n
"
"name1=val1
\r\n
"
"name2=
\"
val2
\"\r\n
"
"name3
\r\n
"
"name4=a
\r\n
"
"[section2]
\r\n
"
;
create_test_file
(
filename
,
content
,
sizeof
(
content
));
trace
(
"test_GetPrivateProfileStringA: %s
\n
"
,
descript
);
create_test_file
(
filename
,
content
,
lstrlenA
(
content
));
/* Run this test series with caching. Wine won't cache profile
files younger than 2.1 seconds. */
...
...
@@ -674,7 +669,7 @@ static void test_GetPrivateProfileString(void)
GetWindowsDirectoryA
(
windir
,
MAX_PATH
);
GetTempFileNameA
(
windir
,
"pre"
,
0
,
path
);
tempfile
=
strrchr
(
path
,
'\\'
)
+
1
;
create_test_file
(
path
,
content
,
sizeof
(
content
));
create_test_file
(
path
,
content
,
lstrlenA
(
content
));
/* only filename is used, file exists in windows directory */
lstrcpyA
(
buf
,
"kumquat"
);
...
...
@@ -703,5 +698,20 @@ START_TEST(profile)
test_profile_existing
();
test_profile_delete_on_close
();
test_profile_refresh
();
test_GetPrivateProfileString
();
test_GetPrivateProfileString
(
"[section1]
\r\n
"
"name1=val1
\r\n
"
"name2=
\"
val2
\"\r\n
"
"name3
\r\n
"
"name4=a
\r\n
"
"[section2]
\r\n
"
,
"CR+LF"
);
test_GetPrivateProfileString
(
"[section1]
\r
"
"name1=val1
\r
"
"name2=
\"
val2
\"\r
"
"name3
\r
"
"name4=a
\r
"
"[section2]
\r
"
,
"CR only"
);
}
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