FreeBASIC  0.91.0
sys_getexename.c
Go to the documentation of this file.
1 /* get the executable's name */
2 
3 #include "../fb.h"
4 
5 char *fb_hGetExeName( char *dst, ssize_t maxlen )
6 {
7  const char *p = strrchr( __fb_ctx.argv[0], '/' );
8  if( p )
9  strlcpy( dst, p + 1, maxlen );
10  else
11  strlcpy( dst, __fb_ctx.argv[0], maxlen );
12  return dst;
13 }