Last change
on this file since 413 was 398, checked in by coas-nagasima, 5 years ago |
mbedTLS版Azure IoT Hub接続サンプルのソースコードを追加
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/x-csrc;charset=UTF-8
|
File size:
281 bytes
|
Line | |
---|
1 | #include <string.h>
|
---|
2 | #include <libgen.h>
|
---|
3 |
|
---|
4 | char *dirname(char *s)
|
---|
5 | {
|
---|
6 | size_t i;
|
---|
7 | if (!s || !*s) return ".";
|
---|
8 | i = strlen(s)-1;
|
---|
9 | for (; s[i]=='/'; i--) if (!i) return "/";
|
---|
10 | for (; s[i]!='/'; i--) if (!i) return ".";
|
---|
11 | for (; s[i]=='/'; i--) if (!i) return "/";
|
---|
12 | s[i+1] = 0;
|
---|
13 | return s;
|
---|
14 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.