aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2013-10-17 22:05:29 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-17 12:19:45 -0700
commit70a3e769e19395dbc07b0be1ce601065a27f607f (patch)
treedbda57d1e9bc39e781f28313b1f3035f5b892056 /file.c
parentf771a94a853bfd08f91dfdd8048867ffc67481b6 (diff)
downloadsubsurface-70a3e769e19395dbc07b0be1ce601065a27f607f.tar.gz
Open CSV files only via the GUI
Since the CSV import transformation is now parametrized and does not have any defaults, we need to use the CSV import GUI. Thus give an error message if one is opening CSV file directly. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'file.c')
-rw-r--r--file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/file.c b/file.c
index acabd1b6b..39d9a256b 100644
--- a/file.c
+++ b/file.c
@@ -260,8 +260,12 @@ static int open_by_filename(const char *filename, const char *fmt, struct memblo
return try_to_open_zip(filename, mem, error);
/* CSV files */
- if (!strcasecmp(fmt, "CSV"))
- return try_to_xslt_open_csv(filename, mem, error);
+ if (!strcasecmp(fmt, "CSV")) {
+ int len = strlen(translate("gettextFromC","Failed to read '%s'. Use import for CSV files.")) + strlen(filename);
+ *error = malloc(len);
+ snprintf(*error, len, translate("gettextFromC","Failed to read '%s'. Use import for CSV files."), filename);
+ return 1;
+ }
#if ONCE_COCHRAN_IS_SUPPORTED
/* Truly nasty intentionally obfuscated Cochran Anal software */