src/misc.c
/*
**	This function makes sure the filename ends in a ".s". If not, it
**	automatically adds it.
*/
This function makes sure the filename ends in a ".s". If not, it
automatically adds it.
This function makes sure the filename ends in a " . s " . If not it automatically adds it .
void		preprocess_filename(char *filename)
{
	int		len;
	len = ft_strlen(filename);
	if (filename[len - 2] == '.' && filename[len - 1] == 's')
		g_filename_in = ft_strdup(filename);
	else
	{
		g_filename_in = ft_strnew(len + 2);
		ft_strcpy(g_filename_in, filename);
		g_filename_in[len] = '.';
		g_filename_in[len + 1] = 's';
	}
}
void preprocess_filename ( char * filename ) { int len ; len = ft_strlen ( filename ) ; if ( filename [ len - 2 ] == ' ' && filename [ len - 1 ] == ' ' ) g_filename_in = ft_strdup ( filename ) ; else { g_filename_in = ft_strnew ( len + 2 ) ; ft_strcpy ( g_filename_in , filename ) ; g_filename_in [ len ] = ' ' ; g_filename_in [ len + 1 ] = ' ' ; } }
This function makes sure the filename ends in a ".s".
This function makes sure the filename ends in a " . s " .