{
DB* dbase;
int status;
- int len;
+ int len, flen, i;
int size;
- char *db_file_name;
+ char *db_file_name, *sp;
status = db_create (&dbase, NULL, 0);
if (status)
return -1;
len = strlen (db_dir);
- size = len + strlen (encoding) + strlen (feature) + 4;
+ flen = strlen (feature);
+ size = len + strlen (encoding) + flen * 3 + 4;
db_file_name = alloca (size);
strcpy (db_file_name, db_dir);
if (db_file_name[len - 1] != '/')
}
strcat (db_file_name, encoding);
strcat (db_file_name, "/");
- strcat (db_file_name, feature);
+ /* strcat (db_file_name, feature); */
+ sp = &db_file_name[strlen (db_file_name)];
+ for (i = 0; i < flen; i++)
+ {
+ int c = feature[i];
+
+ if ( (c == '/') || (c == '%') )
+ {
+ sprintf (sp, "%%%02X", c);
+ sp += 3;
+ }
+ else
+ *sp++ = c;
+ }
+ *sp = '\0';
status = dbase->open (dbase, db_file_name, NULL,
real_subtype, accessmask, modemask);
if (status)