All pastes #739127 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-10-16 21:56 UTC
rendered paste body
static void get_autosave_plumiferos(char buf[FILE_MAXDIR+FILE_MAXFILE])
{
	struct stat st;
	char *home, *p;

	home = BLI_gethome ();
#ifdef WIN32
	sprintf (buf, "%s\\backup", home);
#else
	sprintf (buf, "%s/backup", home);
#endif

	if (stat (buf, &st))
		mkdir (buf, 0777);

#ifdef WIN32
	p - strrchr (G.sce, '\');
#else
	p = strrchr (G.sce, '/');
#endif	
	
	if (!p)
#ifdef WIN32
		sprintf (buf, "%s\\backup\\untitle.blend", home);
#else
		sprintf (buf, "%s/backup/untitle.blend", home);
#endif
	else {
		p++;
#ifdef WIN32
		sprintf (buf, "%s\\backup\\%s", home, p);
#else
		sprintf (buf, "%s/backup/%s", home, p);
#endif
	}