-/* File related stuff
-
- Copyright (C) 1999 Benjamin Herrenschmidt
-
- This program 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; either version 2 of the License, or
- (at your option) any later version.
-
- This program 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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+/*
+ * file.c - Filesystem related interfaces
+ *
+ * Copyright (C) 2001 Ethan Benson
+ *
+ * parse_device_path()
+ *
+ * Copyright (C) 2001 Colin Walters
+ *
+ * Copyright (C) 1999 Benjamin Herrenschmidt
+ *
+ * This program 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
#include "ctype.h"
#include "types.h"
}
}
- if ((ptr = strrchr(ipath, ',')) != NULL) {
- char *colon = strrchr(ipath, ':');
- /* If a ':' occurs *after* a ',', then we assume that there is
- no filename */
- if (!colon || colon < ptr) {
- result->file = strdup(ptr+1);
- /* Trim the filename off */
- *ptr = 0;
+ /* if there is no : then there is no filename or partition. must
+ use strrchr() since enet:,10.0.0.1,file is legal */
+
+ if (strchr(ipath, ':') != NULL) {
+ if ((ptr = strrchr(ipath, ',')) != NULL) {
+ char *colon = strrchr(ipath, ':');
+ /* If a ':' occurs *after* a ',', then we assume that there is
+ no filename */
+ if (!colon || colon < ptr) {
+ result->file = strdup(ptr+1);
+ /* Trim the filename off */
+ *ptr = 0;
+ }
}
}
p->part_number, p->part_start, p->part_size );
if (partition == -1) {
file->fs = fs_open( file, dev_name, p, file_name );
- if (file->fs != NULL)
+ if (file->fs != FILE_ERR_OK)
goto bail;
}
if ((partition >= 0) && (partition == p->part_number))