forked from enlightenment/enlightenment
handle spaces in eap filenames when editing, and proeprly escape things, add
gneric escaper, and reduce file path of icon files nicely. SVN revision: 22587
This commit is contained in:
parent
b24ee237c5
commit
81c249ddeb
1
TODO
1
TODO
|
@ -8,7 +8,6 @@ Some of the things (in very short form) that need to be done to E17...
|
||||||
BUGS / FIXES
|
BUGS / FIXES
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
* BUG: eap editor doesn't handle spaces in file paths for the .eap
|
|
||||||
* BUG: ghost windows happen if windows close when on another desktop or if
|
* BUG: ghost windows happen if windows close when on another desktop or if
|
||||||
windows are very short-lived
|
windows are very short-lived
|
||||||
* BUG: k3b has minimization issues when burning cds (it tries to unminimize
|
* BUG: k3b has minimization issues when burning cds (it tries to unminimize
|
||||||
|
|
|
@ -1419,7 +1419,7 @@ e_app_icon_add(Evas *evas, E_App *a)
|
||||||
static int
|
static int
|
||||||
_e_app_new_save(E_App *a)
|
_e_app_new_save(E_App *a)
|
||||||
{
|
{
|
||||||
static char tmpn[1024];
|
static char tmpn[4096];
|
||||||
int fd = 0, ret = 0;
|
int fd = 0, ret = 0;
|
||||||
char cmd[2048];
|
char cmd[2048];
|
||||||
char ipart[512];
|
char ipart[512];
|
||||||
|
@ -1446,20 +1446,13 @@ _e_app_new_save(E_App *a)
|
||||||
}
|
}
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
if (a->image)
|
if (a->image)
|
||||||
{
|
{
|
||||||
start = strchr(a->image, '/');
|
start = strchr(a->image, '/');
|
||||||
end = strrchr(a->image ,'/');
|
end = strrchr(a->image, '/');
|
||||||
|
|
||||||
if (start == end)
|
if (start == end) imgdir = strdup("/");
|
||||||
{
|
else if ((!start) || (!end)) imgdir = strdup("");
|
||||||
imgdir = strdup("/");;
|
|
||||||
}
|
|
||||||
else if ((!start) || (!end))
|
|
||||||
{
|
|
||||||
imgdir = strdup("");
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
imgdir = malloc((end - start + 1));
|
imgdir = malloc((end - start + 1));
|
||||||
|
@ -1473,24 +1466,27 @@ _e_app_new_save(E_App *a)
|
||||||
|
|
||||||
if (imgdir)
|
if (imgdir)
|
||||||
{
|
{
|
||||||
snprintf(ipart, sizeof(ipart), "-id %s", imgdir);
|
snprintf(ipart, sizeof(ipart), "-id %s",
|
||||||
|
e_util_filename_escape(imgdir));
|
||||||
free(imgdir);
|
free(imgdir);
|
||||||
}
|
}
|
||||||
else ipart[0] = '\0';
|
else ipart[0] = 0;
|
||||||
|
|
||||||
if (a->image)
|
if (a->image)
|
||||||
{
|
{
|
||||||
if (a->width <= 0)
|
if (a->width <= 0) a->width = EAP_MIN_WIDTH;
|
||||||
a->width = EAP_MIN_WIDTH;
|
if (a->height <= 0) a->height = EAP_MIN_HEIGHT;
|
||||||
if (a->height <= 0)
|
fprintf(out, EAP_EDC_TMPL,
|
||||||
a->height = EAP_MIN_HEIGHT;
|
e_util_filename_escape(ecore_file_get_file(a->image)),
|
||||||
fprintf(out, EAP_EDC_TMPL, a->image, a->width, a->height, a->image);
|
a->width, a->height,
|
||||||
|
e_util_filename_escape(ecore_file_get_file(a->image)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fprintf(out, EAP_EDC_TMPL_EMPTY);
|
fprintf(out, EAP_EDC_TMPL_EMPTY);
|
||||||
fclose(out);
|
fclose(out);
|
||||||
|
|
||||||
snprintf(cmd, sizeof(cmd), "edje_cc -v %s %s %s", ipart, tmpn, a->path);
|
snprintf(cmd, sizeof(cmd), "edje_cc -v %s %s %s", ipart, tmpn,
|
||||||
|
e_util_filename_escape(a->path));
|
||||||
ret = system(cmd);
|
ret = system(cmd);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
@ -1500,7 +1496,7 @@ _e_app_new_save(E_App *a)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unlink(tmpn);
|
ecore_file_unlink(tmpn);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -527,6 +527,38 @@ e_util_dialog_internal(const char *title, const char *txt)
|
||||||
e_dialog_show(dia);
|
e_dialog_show(dia);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI const char *
|
||||||
|
e_util_filename_escape(const char *filename)
|
||||||
|
{
|
||||||
|
char *p, *q;
|
||||||
|
static char buf[4096];
|
||||||
|
|
||||||
|
p = filename;
|
||||||
|
q = buf;
|
||||||
|
while (*p)
|
||||||
|
{
|
||||||
|
if ((q - buf) > 4090) return NULL;
|
||||||
|
if (
|
||||||
|
(*p == ' ') || (*p == '\t') || (*p == '\n') ||
|
||||||
|
(*p == '\\') || (*p == '\'') || (*p == '\"') ||
|
||||||
|
(*p == ';') || (*p == '!') || (*p == '#') ||
|
||||||
|
(*p == '$') || (*p == '%') || (*p == '&') ||
|
||||||
|
(*p == '*') || (*p == '(') || (*p == ')') ||
|
||||||
|
(*p == '[') || (*p == ']') || (*p == '{') ||
|
||||||
|
(*p == '}') || (*p == '|') || (*p == '<') ||
|
||||||
|
(*p == '>') || (*p == '?')
|
||||||
|
)
|
||||||
|
{
|
||||||
|
*q = '\\';
|
||||||
|
q++;
|
||||||
|
}
|
||||||
|
*q = *p;
|
||||||
|
q++;
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
/* local subsystem functions */
|
/* local subsystem functions */
|
||||||
static void
|
static void
|
||||||
_e_util_container_fake_mouse_up_cb(void *data)
|
_e_util_container_fake_mouse_up_cb(void *data)
|
||||||
|
|
|
@ -39,6 +39,7 @@ EAPI E_Border *e_util_desk_border_above(E_Border *bd);
|
||||||
EAPI E_Border *e_util_desk_border_below(E_Border *bd);
|
EAPI E_Border *e_util_desk_border_below(E_Border *bd);
|
||||||
EAPI int e_util_edje_collection_exists(const char *file, const char *coll);
|
EAPI int e_util_edje_collection_exists(const char *file, const char *coll);
|
||||||
EAPI void e_util_dialog_internal(const char *title, const char *txt);
|
EAPI void e_util_dialog_internal(const char *title, const char *txt);
|
||||||
|
EAPI const char *e_util_filename_escape(const char *filename);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue