source: azure_iot_hub/trunk/musl-1.1.18/src/misc/basename.c@ 389

Last change on this file since 389 was 389, checked in by coas-nagasima, 5 years ago

ビルドが通るよう更新

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc;charset=UTF-8
File size: 263 bytes
Line 
1#include <string.h>
2#include <libgen.h>
3#include "libc.h"
4
5char *basename(char *s)
6{
7 size_t i;
8 if (!s || !*s) return ".";
9 i = strlen(s)-1;
10 for (; i&&s[i]=='/'; i--) s[i] = 0;
11 for (; i&&s[i-1]!='/'; i--);
12 return s+i;
13}
14
15weak_alias(basename, __xpg_basename);
Note: See TracBrowser for help on using the repository browser.