File: asylum_win.c

package info (click to toggle)
asylum 0.3.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,424 kB
  • sloc: ansic: 7,476; makefile: 91; sh: 43
file content (16 lines) | stat: -rw-r--r-- 246 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <windows.h>

char *get_exe_path(char *buf, int bufsize)
{
	char *p;
	GetModuleFileName(NULL, buf, bufsize);
	while (p = strchr(buf, '\\'))
		*p = '/';
	p = strrchr(buf, '/');
	if (p)
		*p = '\0';
	buf[bufsize-1] = '\0';

	return buf;
}