summaryrefslogtreecommitdiff
path: root/src/helper/fileio.c
diff options
context:
space:
mode:
authordrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-03-28 16:31:55 +0000
committerdrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-03-28 16:31:55 +0000
commit4a5f45e87d593d6911da680cb92ffbc9b43c9486 (patch)
treed41ddb8594b5fab03c12075cbc4d3888d59ed027 /src/helper/fileio.c
parent5ed126c4f90948fbf53d186dc4ef49018fb5ecfc (diff)
downloadopenocd+libswd-4a5f45e87d593d6911da680cb92ffbc9b43c9486.tar.gz
openocd+libswd-4a5f45e87d593d6911da680cb92ffbc9b43c9486.tar.bz2
openocd+libswd-4a5f45e87d593d6911da680cb92ffbc9b43c9486.tar.xz
openocd+libswd-4a5f45e87d593d6911da680cb92ffbc9b43c9486.zip
- 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
Diffstat (limited to 'src/helper/fileio.c')
-rw-r--r--src/helper/fileio.c21
1 files changed, 11 insertions, 10 deletions
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;