Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
paho.mqtt.c
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eclipse
paho.mqtt.c
Commits
c0a56c96
Commit
c0a56c96
authored
Apr 03, 2018
by
Ian Craggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for issue #285
parent
10c895c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
MQTTPersistenceDefault.c
src/MQTTPersistenceDefault.c
+15
-4
No files found.
src/MQTTPersistenceDefault.c
View file @
c0a56c96
/*******************************************************************************
* Copyright (c) 2009, 201
6
IBM Corp.
* Copyright (c) 2009, 201
8
IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
...
...
@@ -14,6 +14,7 @@
* Ian Craggs - initial API and implementation and/or initial documentation
* Ian Craggs - async client updates
* Ian Craggs - fix for bug 484496
* Ian Craggs - fix for issue 285
*******************************************************************************/
/**
...
...
@@ -86,15 +87,25 @@ int pstopen(void **handle, const char* clientID, const char* serverURI, void* co
/* create clientDir directory */
/* pCrtDirName - holds the directory name we are currently trying to create. */
/* This gets built up level by level until the full path name is created.*/
/* This gets built up level by level unti
pwd
l the full path name is created.*/
/* pTokDirName - holds the directory name that gets used by strtok. */
pCrtDirName
=
(
char
*
)
malloc
(
strlen
(
clientDir
)
+
1
);
pTokDirName
=
(
char
*
)
malloc
(
strlen
(
clientDir
)
+
1
);
strcpy
(
pTokDirName
,
clientDir
);
pToken
=
strtok_r
(
pTokDirName
,
"
\\
/"
,
&
save_ptr
);
/* If first character is directory separator, make sure it's in the created directory name #285 */
if
(
*
pTokDirName
==
'/'
||
*
pTokDirName
==
'\\'
)
{
*
pCrtDirName
=
*
pTokDirName
;
pToken
=
strtok_r
(
pTokDirName
+
1
,
"
\\
/"
,
&
save_ptr
);
strcpy
(
pCrtDirName
+
1
,
pToken
);
}
else
{
pToken
=
strtok_r
(
pTokDirName
,
"
\\
/"
,
&
save_ptr
);
strcpy
(
pCrtDirName
,
pToken
);
}
strcpy
(
pCrtDirName
,
pToken
);
rc
=
pstmkdir
(
pCrtDirName
);
pToken
=
strtok_r
(
NULL
,
"
\\
/"
,
&
save_ptr
);
while
(
(
pToken
!=
NULL
)
&&
(
rc
==
0
)
)
...
...
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