/* * Copyright 2010 Ole Loots * * This file is part of NetSurf, http://www.netsurf-browser.org/ * * NetSurf is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * NetSurf is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include #include #include #include "utils/log.h" #include "utils/url.h" #include "atari/gemtk/gemtk.h" #include "atari/findfile.h" #include "atari/misc.h" #include "atari/osspec.h" char * local_file_to_url( const char * filename ) { #define BACKSLASH 0x5C char * url; LOG(("in: %s", filename)); if( strlen(filename) <= 2){ return( NULL ); } char * fname_local = malloc( strlen(filename)+1 ); char * start = (char*)fname_local; strcpy( start, filename ); /* convert backslashes: */ for( unsigned int i=0; i