From 4a5f45e87d593d6911da680cb92ffbc9b43c9486 Mon Sep 17 00:00:00 2001 From: drath Date: Wed, 28 Mar 2007 16:31:55 +0000 Subject: - merged XScale branch back into trunk - fixed some compiler warnigns in amt_jtagaccel.c, bitbang.c, parport.c - free working area and register stuff if str7x block write algorithm failed - check PC after exiting a target algorithm in armv4_5.c git-svn-id: svn://svn.berlios.de/openocd/trunk@135 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/helper/fileio.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/helper/fileio.c') diff --git a/src/helper/fileio.c b/src/helper/fileio.c index 756e0f46..648f1879 100644 --- a/src/helper/fileio.c +++ b/src/helper/fileio.c @@ -242,22 +242,23 @@ int fileio_open(fileio_t *fileio, char *url, enum fileio_access access, enum fileio_pri_type pri_type, void *pri_info, enum fileio_sec_type sec_type) { int retval = ERROR_OK; - - if ((!url) || (strlen(url) < 3)) + char *resource_identifier = NULL; + + /* try to identify file location */ + if ((resource_identifier = strstr(url, "bootp://")) && (resource_identifier == url)) { - snprintf(fileio->error_str, FILEIO_MAX_ERROR_STRING, "invalid file url"); - return ERROR_INVALID_ARGUMENTS; + ERROR("bootp resource location isn't supported yet"); + return ERROR_FILEIO_RESOURCE_TYPE_UNKNOWN; } - - if ((url[0] == '/') || (isalpha(url[0])) || ((url[1] == ':') && (url[2] == '\\'))) + else if ((resource_identifier = strstr(url, "tftp://")) && (resource_identifier == url)) { - fileio->location = FILEIO_LOCAL; + ERROR("tftp resource location isn't supported yet"); + return ERROR_FILEIO_RESOURCE_TYPE_UNKNOWN; } else { - ERROR("couldn't identify resource location from URL '%s'", url); - snprintf(fileio->error_str, FILEIO_MAX_ERROR_STRING, "couldn't identify resource location from URL '%s'", url); - return ERROR_FILEIO_LOCATION_UNKNOWN; + /* default to local files */ + fileio->location = FILEIO_LOCAL; } fileio->access = access; -- cgit v1.2.3