Renamed duplicate to Estrdup, introduced Estrndup.
SVN revision: 9148
This commit is contained in:
parent
677c2298dc
commit
f43c79641d
|
@ -60,6 +60,7 @@ AC_CHECK_FUNCS(snprintf)
|
|||
AM_CONDITIONAL(USE_ESNPRINTF, test "x$ac_cv_func_snprintf" != "xyes")
|
||||
AC_CHECK_FUNCS(strcasecmp)
|
||||
AC_CHECK_FUNCS(setenv)
|
||||
AC_CHECK_FUNCS(strdup strndup)
|
||||
|
||||
AC_CHECK_FUNCS(blumfrub)
|
||||
AC_CHECK_FUNCS(buckets_of_erogenous_nym)
|
||||
|
|
9
eesh/E.h
9
eesh/E.h
|
@ -48,6 +48,8 @@
|
|||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
|
||||
#define USE_STRDUP 1
|
||||
|
||||
#define LIST_FINDBY_NAME 0
|
||||
#define LIST_FINDBY_ID 1
|
||||
#define LIST_FINDBY_BOTH 2
|
||||
|
@ -145,10 +147,15 @@ __Emalloc(x)
|
|||
__Erealloc(x, y)
|
||||
#endif
|
||||
|
||||
#if defined(USE_STRDUP) && defined(HAVE_STRDUP)
|
||||
#define Estrdup(s) ((s) ? strdup(s) : NULL)
|
||||
#else
|
||||
char *Estrdup(const char *s);
|
||||
#endif
|
||||
|
||||
void *__Emalloc(int size);
|
||||
void *__Erealloc(void *ptr, int size);
|
||||
void __Efree(void *ptr);
|
||||
char *duplicate(char *s);
|
||||
|
||||
#define FILEPATH_LEN_MAX 4096
|
||||
/* This turns on E's internal stack tracking system for coarse debugging */
|
||||
|
|
|
@ -77,7 +77,7 @@ AssignTitleText(char *text)
|
|||
if (TitleText)
|
||||
Efree(TitleText);
|
||||
TitleText = NULL;
|
||||
TitleText = duplicate(text);
|
||||
TitleText = Estrdup(text);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -86,7 +86,7 @@ AssignIgnoreText(char *text)
|
|||
if (IgnoreText)
|
||||
Efree(IgnoreText);
|
||||
IgnoreText = NULL;
|
||||
IgnoreText = duplicate(text);
|
||||
IgnoreText = Estrdup(text);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -95,7 +95,7 @@ AssignRestartText(char *text)
|
|||
if (RestartText)
|
||||
Efree(RestartText);
|
||||
RestartText = NULL;
|
||||
RestartText = duplicate(text);
|
||||
RestartText = Estrdup(text);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -104,7 +104,7 @@ AssignExitText(char *text)
|
|||
if (ExitText)
|
||||
Efree(ExitText);
|
||||
ExitText = NULL;
|
||||
ExitText = duplicate(text);
|
||||
ExitText = Estrdup(text);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -148,7 +148,7 @@ CommsGet(Client ** c, XEvent * ev)
|
|||
if (!cl)
|
||||
EDBUG_RETURN(NULL);
|
||||
sprintf(st, "%8x", (int)win);
|
||||
cl->name = duplicate(st);
|
||||
cl->name = Estrdup(st);
|
||||
AddItem((void *)cl, st, cl->win, LIST_TYPE_CLIENT);
|
||||
XSelectInput(disp, win, StructureNotifyMask | SubstructureNotifyMask);
|
||||
}
|
||||
|
|
26
eesh/file.c
26
eesh/file.c
|
@ -280,7 +280,7 @@ cwd(void)
|
|||
|
||||
EDBUG(9, "cwd");
|
||||
getcwd(ss, FILEPATH_LEN_MAX);
|
||||
s = duplicate(ss);
|
||||
s = Estrdup(ss);
|
||||
EDBUG_RETURN(s);
|
||||
}
|
||||
|
||||
|
@ -333,11 +333,11 @@ username(int uid)
|
|||
pwd = getpwuid(uid);
|
||||
if (pwd)
|
||||
{
|
||||
s = duplicate(pwd->pw_name);
|
||||
s = Estrdup(pwd->pw_name);
|
||||
/* Efree(pwd); */
|
||||
EDBUG_RETURN(s);
|
||||
}
|
||||
EDBUG_RETURN(duplicate("unknown"));
|
||||
EDBUG_RETURN(Estrdup("unknown"));
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -350,11 +350,11 @@ homedir(int uid)
|
|||
pwd = getpwuid(uid);
|
||||
if (pwd)
|
||||
{
|
||||
s = duplicate(pwd->pw_dir);
|
||||
s = Estrdup(pwd->pw_dir);
|
||||
/* Efree(pwd); */
|
||||
EDBUG_RETURN(s);
|
||||
}
|
||||
EDBUG_RETURN(duplicate("/tmp"));
|
||||
EDBUG_RETURN(Estrdup("/tmp"));
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -367,11 +367,11 @@ usershell(int uid)
|
|||
pwd = getpwuid(uid);
|
||||
if (pwd)
|
||||
{
|
||||
s = duplicate(pwd->pw_shell);
|
||||
s = Estrdup(pwd->pw_shell);
|
||||
/* Efree(pwd); */
|
||||
EDBUG_RETURN(s);
|
||||
}
|
||||
EDBUG_RETURN(duplicate("/bin/sh"));
|
||||
EDBUG_RETURN(Estrdup("/bin/sh"));
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -534,7 +534,7 @@ fileof(char *s)
|
|||
for (i = 0; i < (p2 - p1 - 1); i++)
|
||||
ss[i] = s[p1 + 1 + i];
|
||||
ss[i] = 0;
|
||||
EDBUG_RETURN(duplicate(ss));
|
||||
EDBUG_RETURN(Estrdup(ss));
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -555,7 +555,7 @@ fullfileof(char *s)
|
|||
for (i = 0; i < (p2 - p1 - 1); i++)
|
||||
ss[i] = s[p1 + 1 + i];
|
||||
ss[i] = 0;
|
||||
EDBUG_RETURN(duplicate(ss));
|
||||
EDBUG_RETURN(Estrdup(ss));
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -569,11 +569,11 @@ pathtoexec(char *file)
|
|||
if (file[0] == '/')
|
||||
{
|
||||
if (canexec(file))
|
||||
EDBUG_RETURN(duplicate(file));
|
||||
EDBUG_RETURN(Estrdup(file));
|
||||
}
|
||||
p = getenv("PATH");
|
||||
if (!p)
|
||||
EDBUG_RETURN(duplicate(file));
|
||||
EDBUG_RETURN(Estrdup(file));
|
||||
if (!file)
|
||||
EDBUG_RETURN(NULL);
|
||||
cp = p;
|
||||
|
@ -622,11 +622,11 @@ pathtofile(char *file)
|
|||
if (file[0] == '/')
|
||||
{
|
||||
if (exists(file))
|
||||
EDBUG_RETURN(duplicate(file));
|
||||
EDBUG_RETURN(Estrdup(file));
|
||||
}
|
||||
p = getenv("PATH");
|
||||
if (!p)
|
||||
EDBUG_RETURN(duplicate(file));
|
||||
EDBUG_RETURN(Estrdup(file));
|
||||
if (!file)
|
||||
EDBUG_RETURN(NULL);
|
||||
cp = p;
|
||||
|
|
|
@ -81,7 +81,7 @@ AddItem(void *item, char *name, int id, int type)
|
|||
if (!ptr)
|
||||
EDBUG_RETURN_;
|
||||
ptr->item = item;
|
||||
ptr->name = duplicate(name);
|
||||
ptr->name = Estrdup(name);
|
||||
ptr->id = id;
|
||||
ptr->type = type;
|
||||
ptr->next = lists.next;
|
||||
|
@ -260,7 +260,7 @@ ListItems(int *num, int type)
|
|||
{
|
||||
if (ptr->type == type)
|
||||
{
|
||||
list[i] = duplicate(ptr->name);
|
||||
list[i] = Estrdup(ptr->name);
|
||||
i++;
|
||||
}
|
||||
ptr = ptr->next;
|
||||
|
@ -270,7 +270,7 @@ ListItems(int *num, int type)
|
|||
{
|
||||
while (ptr)
|
||||
{
|
||||
list[i] = duplicate(ptr->name);
|
||||
list[i] = Estrdup(ptr->name);
|
||||
i++;
|
||||
ptr = ptr->next;
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ main(int argc, char **argv)
|
|||
else if (!strcmp(argv[i], "-display"))
|
||||
{
|
||||
if (i != (argc - 1))
|
||||
display_name = duplicate(argv[++i]);
|
||||
display_name = Estrdup(argv[++i]);
|
||||
}
|
||||
else if ((!strcmp(argv[i], "-h")) ||
|
||||
(!strcmp(argv[i], "--h")) ||
|
||||
|
|
|
@ -152,8 +152,9 @@ __Efree(void *ptr)
|
|||
EDBUG_RETURN_;
|
||||
}
|
||||
|
||||
#if !(defined(USE_STRDUP) && defined(HAVE_STRDUP))
|
||||
char *
|
||||
duplicate(char *s)
|
||||
Estrdup(const char *s)
|
||||
{
|
||||
char *ss;
|
||||
int sz;
|
||||
|
@ -166,3 +167,4 @@ duplicate(char *s)
|
|||
strncpy(ss, s, sz + 1);
|
||||
EDBUG_RETURN(ss);
|
||||
}
|
||||
#endif
|
||||
|
|
15
src/E.h
15
src/E.h
|
@ -35,6 +35,9 @@
|
|||
#include <X11/extensions/shape.h>
|
||||
#include <X11/extensions/XShm.h>
|
||||
|
||||
#define USE_STRDUP 1
|
||||
#define DEBUG_EWMH 0
|
||||
|
||||
#define ESetColor(pxc, r, g, b) \
|
||||
({ (pxc)->red = ((r)<<8)|r; (pxc)->green = ((g)<<8)|g; (pxc)->blue = ((b)<<8)|b; })
|
||||
#define EGetColor(pxc, pr, pg, pb) \
|
||||
|
@ -149,9 +152,6 @@ extern Drawable vIcDrw;
|
|||
#include <Fnlib.h>
|
||||
#endif
|
||||
|
||||
#define USE_STRDUP 1
|
||||
#define DEBUG_EWMH 0
|
||||
|
||||
#define XSync(d, f) \
|
||||
{XImage *__xim; \
|
||||
__xim = XGetImage(d, root.win, 0, 0, 1, 1, 0xffffffff, ZPixmap); \
|
||||
|
@ -2692,9 +2692,14 @@ __Erealloc(x, y, "<unknown>", 0)
|
|||
#endif
|
||||
|
||||
#if defined(USE_STRDUP) && defined(HAVE_STRDUP)
|
||||
#define duplicate(p) ((p) ? strdup(p) : NULL)
|
||||
#define Estrdup(s) ((s) ? strdup(s) : NULL)
|
||||
#else
|
||||
char *duplicate(const char *s);
|
||||
char *Estrdup(const char *s);
|
||||
#endif
|
||||
#if defined(USE_STRDUP) && defined(HAVE_STRNDUP)
|
||||
#define Estrndup(s,n) ((s) ? strndup(s,n) : NULL)
|
||||
#else
|
||||
char *Estrndup(const char *s, int n);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
@ -42,7 +42,7 @@ CreateAclass(char *name)
|
|||
|
||||
EDBUG(5, "CreateAclass");
|
||||
a = Emalloc(sizeof(ActionClass));
|
||||
a->name = duplicate(name);
|
||||
a->name = Estrdup(name);
|
||||
a->num = 0;
|
||||
a->list = NULL;
|
||||
a->tooltipstring = NULL;
|
||||
|
@ -222,9 +222,9 @@ CreateAction(char event, char anymod, int mod, int anybut, int but,
|
|||
act->key = 0;
|
||||
else
|
||||
act->key = XKeysymToKeycode(disp, XStringToKeysym(key));
|
||||
act->key_str = duplicate(key);
|
||||
act->key_str = Estrdup(key);
|
||||
if (tooltipstring)
|
||||
act->tooltipstring = duplicate(tooltipstring);
|
||||
act->tooltipstring = Estrdup(tooltipstring);
|
||||
else
|
||||
act->tooltipstring = NULL;
|
||||
|
||||
|
@ -841,7 +841,7 @@ doAlert(EWin * edummy, void *params)
|
|||
|
||||
EDBUG(6, "doAlert");
|
||||
|
||||
pp = duplicate((char *)params);
|
||||
pp = Estrdup((char *)params);
|
||||
if (!pp)
|
||||
EDBUG_RETURN(1);
|
||||
if (strlen(pp) <= 0)
|
||||
|
|
|
@ -62,7 +62,7 @@ AssignTitleText(char *text)
|
|||
|
||||
if (TitleText)
|
||||
Efree(TitleText);
|
||||
TitleText = duplicate(text);
|
||||
TitleText = Estrdup(text);
|
||||
|
||||
EDBUG_RETURN_;
|
||||
}
|
||||
|
|
|
@ -2255,7 +2255,7 @@ CreateBorder(char *name)
|
|||
if (!b)
|
||||
EDBUG_RETURN(NULL);
|
||||
|
||||
b->name = duplicate(name);
|
||||
b->name = Estrdup(name);
|
||||
b->group_border_name = NULL;
|
||||
b->border.left = 0;
|
||||
b->border.right = 0;
|
||||
|
|
|
@ -36,8 +36,8 @@ ButtonCreate(char *name, ImageClass * iclass, ActionClass * aclass,
|
|||
|
||||
b = Emalloc(sizeof(Button));
|
||||
|
||||
b->name = duplicate(name);
|
||||
b->label = duplicate(label);
|
||||
b->name = Estrdup(name);
|
||||
b->label = Estrdup(label);
|
||||
|
||||
b->iclass = iclass;
|
||||
if (!b->iclass)
|
||||
|
|
|
@ -117,7 +117,7 @@ CreateCMClass(char *name, int rnum, unsigned char *rpx,
|
|||
if (!cm)
|
||||
EDBUG_RETURN(NULL);
|
||||
|
||||
cm->name = duplicate(name);
|
||||
cm->name = Estrdup(name);
|
||||
cm->red.px = NULL;
|
||||
cm->red.py = NULL;
|
||||
cm->green.px = NULL;
|
||||
|
|
34
src/comms.c
34
src/comms.c
|
@ -217,7 +217,7 @@ CommsGet(Client ** c, XClientMessageEvent * ev)
|
|||
if (!cl)
|
||||
EDBUG_RETURN(NULL);
|
||||
Esnprintf(st, sizeof(st), "%8x", (int)win);
|
||||
cl->name = duplicate(st);
|
||||
cl->name = Estrdup(st);
|
||||
AddItem((void *)cl, st, cl->win, LIST_TYPE_CLIENT);
|
||||
XSelectInput(disp, win, StructureNotifyMask | SubstructureNotifyMask);
|
||||
}
|
||||
|
@ -361,43 +361,43 @@ HandleComms(XClientMessageEvent * ev)
|
|||
{
|
||||
if (c->clientname)
|
||||
Efree(c->clientname);
|
||||
c->clientname = duplicate(atword(s, 3));
|
||||
c->clientname = Estrdup(atword(s, 3));
|
||||
}
|
||||
else if (!strcmp(w, "version"))
|
||||
{
|
||||
if (c->version)
|
||||
Efree(c->version);
|
||||
c->version = duplicate(atword(s, 3));
|
||||
c->version = Estrdup(atword(s, 3));
|
||||
}
|
||||
else if (!strcmp(w, "author"))
|
||||
{
|
||||
if (c->author)
|
||||
Efree(c->author);
|
||||
c->author = duplicate(atword(s, 3));
|
||||
c->author = Estrdup(atword(s, 3));
|
||||
}
|
||||
else if (!strcmp(w, "email"))
|
||||
{
|
||||
if (c->email)
|
||||
Efree(c->email);
|
||||
c->email = duplicate(atword(s, 3));
|
||||
c->email = Estrdup(atword(s, 3));
|
||||
}
|
||||
else if (!strcmp(w, "web"))
|
||||
{
|
||||
if (c->web)
|
||||
Efree(c->web);
|
||||
c->web = duplicate(atword(s, 3));
|
||||
c->web = Estrdup(atword(s, 3));
|
||||
}
|
||||
else if (!strcmp(w, "address"))
|
||||
{
|
||||
if (c->address)
|
||||
Efree(c->address);
|
||||
c->address = duplicate(atword(s, 3));
|
||||
c->address = Estrdup(atword(s, 3));
|
||||
}
|
||||
else if (!strcmp(w, "info"))
|
||||
{
|
||||
if (c->info)
|
||||
Efree(c->info);
|
||||
c->info = duplicate(atword(s, 3));
|
||||
c->info = Estrdup(atword(s, 3));
|
||||
}
|
||||
else if (!strcmp(w, "pixmap"))
|
||||
{
|
||||
|
@ -700,7 +700,7 @@ HandleComms(XClientMessageEvent * ev)
|
|||
strcat(buf, buf2);
|
||||
}
|
||||
else
|
||||
buf = duplicate(buf2);
|
||||
buf = Estrdup(buf2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -800,7 +800,7 @@ HandleComms(XClientMessageEvent * ev)
|
|||
GrabActionKey(a);
|
||||
AddAction(ac, a);
|
||||
if (atword(buf, 4))
|
||||
AddToAction(a, act_id, duplicate(atword(buf, 4)));
|
||||
AddToAction(a, act_id, Estrdup(atword(buf, 4)));
|
||||
else
|
||||
AddToAction(a, act_id, NULL);
|
||||
}
|
||||
|
@ -919,7 +919,7 @@ HandleComms(XClientMessageEvent * ev)
|
|||
sscanf(s, "%*s %1000s", w);
|
||||
cm = (ColorModifierClass *) FindItem(w, 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_COLORMODIFIER);
|
||||
name = duplicate(w);
|
||||
name = Estrdup(w);
|
||||
i = 3;
|
||||
word(s, i++, w);
|
||||
rnum = atoi(w);
|
||||
|
@ -1057,13 +1057,13 @@ HandleComms(XClientMessageEvent * ev)
|
|||
|
||||
if (bg)
|
||||
{
|
||||
name = duplicate(w);
|
||||
name = Estrdup(w);
|
||||
word(s, 6, w);
|
||||
if (strcmp("(null)", w))
|
||||
bgf = duplicate(w);
|
||||
bgf = Estrdup(w);
|
||||
word(s, 13, w);
|
||||
if (strcmp("(null)", w))
|
||||
topf = duplicate(w);
|
||||
topf = Estrdup(w);
|
||||
|
||||
if (xclr.red != bg->bg_solid.red)
|
||||
updated = 1;
|
||||
|
@ -1150,13 +1150,13 @@ HandleComms(XClientMessageEvent * ev)
|
|||
}
|
||||
else
|
||||
{
|
||||
name = duplicate(w);
|
||||
name = Estrdup(w);
|
||||
word(s, 6, w);
|
||||
if (strcmp("(null)", w))
|
||||
bgf = duplicate(w);
|
||||
bgf = Estrdup(w);
|
||||
word(s, 13, w);
|
||||
if (strcmp("(null)", w))
|
||||
topf = duplicate(w);
|
||||
topf = Estrdup(w);
|
||||
bg = CreateDesktopBG(name, &xclr, bgf, tile, keep_aspect, xjust,
|
||||
yjust, xperc, yperc, topf, tkeep_aspect,
|
||||
txjust, tyjust, txperc, typerc);
|
||||
|
|
130
src/config.c
130
src/config.c
|
@ -272,7 +272,7 @@ Config_Text(FILE * ConfigFile)
|
|||
case CONFIG_CLASSNAME:
|
||||
SKIP_If_EXISTS(s2, LIST_TYPE_TCLASS);
|
||||
tc = CreateTclass();
|
||||
tc->name = duplicate(s2);
|
||||
tc->name = Estrdup(s2);
|
||||
break;
|
||||
case TEXT_ORIENTATION:
|
||||
if (ts)
|
||||
|
@ -288,7 +288,7 @@ Config_Text(FILE * ConfigFile)
|
|||
tc->norm.normal = ts = CreateTextState();
|
||||
if (ts)
|
||||
{
|
||||
ts->fontname = duplicate(s2);
|
||||
ts->fontname = Estrdup(s2);
|
||||
ts->style.mode = MODE_VERBATIM;
|
||||
}
|
||||
break;
|
||||
|
@ -297,7 +297,7 @@ Config_Text(FILE * ConfigFile)
|
|||
tc->norm.clicked = ts = CreateTextState();
|
||||
if (ts)
|
||||
{
|
||||
ts->fontname = duplicate(s2);
|
||||
ts->fontname = Estrdup(s2);
|
||||
ts->style.mode = MODE_VERBATIM;
|
||||
}
|
||||
break;
|
||||
|
@ -306,7 +306,7 @@ Config_Text(FILE * ConfigFile)
|
|||
tc->norm.hilited = ts = CreateTextState();
|
||||
if (ts)
|
||||
{
|
||||
ts->fontname = duplicate(s2);
|
||||
ts->fontname = Estrdup(s2);
|
||||
ts->style.mode = MODE_VERBATIM;
|
||||
}
|
||||
break;
|
||||
|
@ -315,7 +315,7 @@ Config_Text(FILE * ConfigFile)
|
|||
tc->norm.disabled = ts = CreateTextState();
|
||||
if (ts)
|
||||
{
|
||||
ts->fontname = duplicate(s2);
|
||||
ts->fontname = Estrdup(s2);
|
||||
ts->style.mode = MODE_VERBATIM;
|
||||
}
|
||||
break;
|
||||
|
@ -324,7 +324,7 @@ Config_Text(FILE * ConfigFile)
|
|||
tc->sticky.normal = ts = CreateTextState();
|
||||
if (ts)
|
||||
{
|
||||
ts->fontname = duplicate(s2);
|
||||
ts->fontname = Estrdup(s2);
|
||||
ts->style.mode = MODE_VERBATIM;
|
||||
}
|
||||
break;
|
||||
|
@ -333,7 +333,7 @@ Config_Text(FILE * ConfigFile)
|
|||
tc->sticky.clicked = ts = CreateTextState();
|
||||
if (ts)
|
||||
{
|
||||
ts->fontname = duplicate(s2);
|
||||
ts->fontname = Estrdup(s2);
|
||||
ts->style.mode = MODE_VERBATIM;
|
||||
}
|
||||
break;
|
||||
|
@ -342,7 +342,7 @@ Config_Text(FILE * ConfigFile)
|
|||
tc->sticky.hilited = ts = CreateTextState();
|
||||
if (ts)
|
||||
{
|
||||
ts->fontname = duplicate(s2);
|
||||
ts->fontname = Estrdup(s2);
|
||||
ts->style.mode = MODE_VERBATIM;
|
||||
}
|
||||
break;
|
||||
|
@ -351,7 +351,7 @@ Config_Text(FILE * ConfigFile)
|
|||
tc->sticky.disabled = ts = CreateTextState();
|
||||
if (ts)
|
||||
{
|
||||
ts->fontname = duplicate(s2);
|
||||
ts->fontname = Estrdup(s2);
|
||||
ts->style.mode = MODE_VERBATIM;
|
||||
}
|
||||
break;
|
||||
|
@ -360,7 +360,7 @@ Config_Text(FILE * ConfigFile)
|
|||
tc->active.normal = ts = CreateTextState();
|
||||
if (ts)
|
||||
{
|
||||
ts->fontname = duplicate(s2);
|
||||
ts->fontname = Estrdup(s2);
|
||||
ts->style.mode = MODE_VERBATIM;
|
||||
}
|
||||
break;
|
||||
|
@ -369,7 +369,7 @@ Config_Text(FILE * ConfigFile)
|
|||
tc->active.clicked = ts = CreateTextState();
|
||||
if (ts)
|
||||
{
|
||||
ts->fontname = duplicate(s2);
|
||||
ts->fontname = Estrdup(s2);
|
||||
ts->style.mode = MODE_VERBATIM;
|
||||
}
|
||||
break;
|
||||
|
@ -378,7 +378,7 @@ Config_Text(FILE * ConfigFile)
|
|||
tc->active.hilited = ts = CreateTextState();
|
||||
if (ts)
|
||||
{
|
||||
ts->fontname = duplicate(s2);
|
||||
ts->fontname = Estrdup(s2);
|
||||
ts->style.mode = MODE_VERBATIM;
|
||||
}
|
||||
break;
|
||||
|
@ -387,7 +387,7 @@ Config_Text(FILE * ConfigFile)
|
|||
tc->active.disabled = ts = CreateTextState();
|
||||
if (ts)
|
||||
{
|
||||
ts->fontname = duplicate(s2);
|
||||
ts->fontname = Estrdup(s2);
|
||||
ts->style.mode = MODE_VERBATIM;
|
||||
}
|
||||
break;
|
||||
|
@ -396,7 +396,7 @@ Config_Text(FILE * ConfigFile)
|
|||
tc->sticky_active.normal = ts = CreateTextState();
|
||||
if (ts)
|
||||
{
|
||||
ts->fontname = duplicate(s2);
|
||||
ts->fontname = Estrdup(s2);
|
||||
ts->style.mode = MODE_VERBATIM;
|
||||
}
|
||||
break;
|
||||
|
@ -405,7 +405,7 @@ Config_Text(FILE * ConfigFile)
|
|||
tc->sticky_active.clicked = ts = CreateTextState();
|
||||
if (ts)
|
||||
{
|
||||
ts->fontname = duplicate(s2);
|
||||
ts->fontname = Estrdup(s2);
|
||||
ts->style.mode = MODE_VERBATIM;
|
||||
}
|
||||
break;
|
||||
|
@ -414,7 +414,7 @@ Config_Text(FILE * ConfigFile)
|
|||
tc->sticky_active.hilited = ts = CreateTextState();
|
||||
if (ts)
|
||||
{
|
||||
ts->fontname = duplicate(s2);
|
||||
ts->fontname = Estrdup(s2);
|
||||
ts->style.mode = MODE_VERBATIM;
|
||||
}
|
||||
break;
|
||||
|
@ -423,7 +423,7 @@ Config_Text(FILE * ConfigFile)
|
|||
tc->sticky_active.disabled = ts = CreateTextState();
|
||||
if (ts)
|
||||
{
|
||||
ts->fontname = duplicate(s2);
|
||||
ts->fontname = Estrdup(s2);
|
||||
ts->style.mode = MODE_VERBATIM;
|
||||
}
|
||||
break;
|
||||
|
@ -510,7 +510,7 @@ Config_Slideout(FILE * ConfigFile)
|
|||
case CONFIG_CLASSNAME:
|
||||
if (name)
|
||||
Efree(name);
|
||||
name = duplicate(s2);
|
||||
name = Estrdup(s2);
|
||||
break;
|
||||
case SLIDEOUT_DIRECTION:
|
||||
slideout = SlideoutCreate(name, (char)atoi(s2));
|
||||
|
@ -903,7 +903,7 @@ Config_MenuStyle(FILE * ConfigFile)
|
|||
ms = MenuStyleCreate();
|
||||
if (ms->name)
|
||||
Efree(ms->name);
|
||||
ms->name = duplicate(s2);
|
||||
ms->name = Estrdup(s2);
|
||||
break;
|
||||
case CONFIG_TEXT:
|
||||
ms->tclass = FindItem(s2, 0, LIST_FINDBY_NAME, LIST_TYPE_TCLASS);
|
||||
|
@ -955,7 +955,7 @@ Config_MenuStyle(FILE * ConfigFile)
|
|||
if (ms->border_name)
|
||||
Efree(ms->border_name);
|
||||
|
||||
ms->border_name = duplicate(s2);
|
||||
ms->border_name = Estrdup(s2);
|
||||
|
||||
b = (Border *) FindItem(ms->border_name, 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_BORDER);
|
||||
|
@ -1140,7 +1140,7 @@ Config_Menu(FILE * ConfigFile)
|
|||
if (strcmp("NULL", s2))
|
||||
ic = FindItem(s2, 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
|
||||
mi = NULL;
|
||||
txt = duplicate(atword(s, 3));
|
||||
txt = Estrdup(atword(s, 3));
|
||||
break;
|
||||
case MENU_ACTION:
|
||||
if ((txt) || (ic))
|
||||
|
@ -1398,7 +1398,7 @@ Config_Border(FILE * ConfigFile)
|
|||
b = CreateBorder(s2);
|
||||
break;
|
||||
case BORDER_GROUP_NAME:
|
||||
b->group_border_name = duplicate(s2);
|
||||
b->group_border_name = Estrdup(s2);
|
||||
break;
|
||||
case BORDER_LEFT:
|
||||
b->border.left = atoi(s2);
|
||||
|
@ -1505,7 +1505,7 @@ Config_Button(FILE * ConfigFile)
|
|||
pbt->tclass = tc;
|
||||
break;
|
||||
case BUTTON_LABEL:
|
||||
label = duplicate(atword(s, 2));
|
||||
label = Estrdup(atword(s, 2));
|
||||
if (pbt)
|
||||
pbt->label = label;
|
||||
break;
|
||||
|
@ -1518,7 +1518,7 @@ Config_Button(FILE * ConfigFile)
|
|||
case BUTTON_NAME:
|
||||
if (name)
|
||||
Efree(name);
|
||||
name = duplicate(s2);
|
||||
name = Estrdup(s2);
|
||||
pbt = FindItem(name, 0, LIST_FINDBY_NAME, LIST_TYPE_BUTTON);
|
||||
break;
|
||||
case CONFIG_ACTIONCLASS:
|
||||
|
@ -1769,7 +1769,7 @@ Config_Desktop(FILE * ConfigFile)
|
|||
{
|
||||
if (name)
|
||||
Efree(name);
|
||||
name = duplicate(s2);
|
||||
name = Estrdup(s2);
|
||||
}
|
||||
break;
|
||||
case BG_DESKNUM:
|
||||
|
@ -1850,7 +1850,7 @@ Config_Desktop(FILE * ConfigFile)
|
|||
{
|
||||
if (bg1)
|
||||
Efree(bg1);
|
||||
bg1 = duplicate(s2);
|
||||
bg1 = Estrdup(s2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1861,7 +1861,7 @@ Config_Desktop(FILE * ConfigFile)
|
|||
Efree(bg->top.file);
|
||||
bg->top.file = NULL;
|
||||
}
|
||||
bg->bg.file = duplicate(s2);
|
||||
bg->bg.file = Estrdup(s2);
|
||||
bg->bg_tile = i1;
|
||||
bg->bg.keep_aspect = i2;
|
||||
bg->bg.xjust = i3;
|
||||
|
@ -1877,11 +1877,11 @@ Config_Desktop(FILE * ConfigFile)
|
|||
{
|
||||
if (bg2)
|
||||
Efree(bg2);
|
||||
bg2 = duplicate(s2);
|
||||
bg2 = Estrdup(s2);
|
||||
}
|
||||
else
|
||||
{
|
||||
bg->top.file = duplicate(s2);
|
||||
bg->top.file = Estrdup(s2);
|
||||
bg->top.keep_aspect = j1;
|
||||
bg->top.xjust = j2;
|
||||
bg->top.yjust = j3;
|
||||
|
@ -1959,7 +1959,7 @@ Config_ECursor(FILE * ConfigFile)
|
|||
SKIP_If_EXISTS(s2, LIST_TYPE_ECURSOR);
|
||||
if (name)
|
||||
Efree(name);
|
||||
name = duplicate(s2);
|
||||
name = Estrdup(s2);
|
||||
break;
|
||||
case CURS_BG_RGB:
|
||||
EGetColor(&xclr, &r, &g, &b);
|
||||
|
@ -1972,7 +1972,7 @@ Config_ECursor(FILE * ConfigFile)
|
|||
ESetColor(&xclr, r, g, b);
|
||||
break;
|
||||
case XBM_FILE:
|
||||
file = duplicate(s2);
|
||||
file = Estrdup(s2);
|
||||
break;
|
||||
case NATIVE_ID:
|
||||
sscanf(s, "%4000s %d", s2, &native_id);
|
||||
|
@ -2251,7 +2251,7 @@ Config_ActionClass(FILE * ConfigFile)
|
|||
case ACLASS_KEY:
|
||||
if (key)
|
||||
Efree(key);
|
||||
key = duplicate(s2);
|
||||
key = Estrdup(s2);
|
||||
break;
|
||||
case ACLASS_EVENT_TRIGGER:
|
||||
event = atoi(s2);
|
||||
|
@ -2286,7 +2286,7 @@ Config_ActionClass(FILE * ConfigFile)
|
|||
if (!s3[0])
|
||||
AddToAction(a, atoi(s2), NULL);
|
||||
else
|
||||
AddToAction(a, atoi(s2), duplicate(atword(s, 3)));
|
||||
AddToAction(a, atoi(s2), Estrdup(atword(s, 3)));
|
||||
break;
|
||||
case CONFIG_ACTION_TOOLTIP:
|
||||
if (action_tooltipstring)
|
||||
|
@ -2300,7 +2300,7 @@ Config_ActionClass(FILE * ConfigFile)
|
|||
strcat(action_tooltipstring, atword(s, 2));
|
||||
}
|
||||
else
|
||||
action_tooltipstring = duplicate(atword(s, 2));
|
||||
action_tooltipstring = Estrdup(atword(s, 2));
|
||||
break;
|
||||
case CONFIG_TOOLTIP:
|
||||
if (ac->tooltipstring)
|
||||
|
@ -2313,7 +2313,7 @@ Config_ActionClass(FILE * ConfigFile)
|
|||
ac->tooltipstring = strcat(ac->tooltipstring, atword(s, 2));
|
||||
}
|
||||
else
|
||||
ac->tooltipstring = duplicate(atword(s, 2));
|
||||
ac->tooltipstring = Estrdup(atword(s, 2));
|
||||
break;
|
||||
default:
|
||||
RecoverUserConfig();
|
||||
|
@ -2449,88 +2449,88 @@ Config_ImageClass(FILE * ConfigFile)
|
|||
case ICLASS_NAME:
|
||||
SKIP_If_EXISTS(s2, LIST_TYPE_ICLASS);
|
||||
ic = CreateIclass();
|
||||
ic->name = duplicate(s2);
|
||||
ic->name = Estrdup(s2);
|
||||
break;
|
||||
case CONFIG_DESKTOP:
|
||||
/* don't ask... --mandrake */
|
||||
case ICLASS_NORMAL:
|
||||
ic->norm.normal = CreateImageState();
|
||||
ic->norm.normal->im_file = duplicate(s2);
|
||||
ic->norm.normal->im_file = Estrdup(s2);
|
||||
ICToRead = ic->norm.normal;
|
||||
break;
|
||||
case ICLASS_CLICKED:
|
||||
ic->norm.clicked = CreateImageState();
|
||||
ic->norm.clicked->im_file = duplicate(s2);
|
||||
ic->norm.clicked->im_file = Estrdup(s2);
|
||||
ICToRead = ic->norm.clicked;
|
||||
break;
|
||||
case ICLASS_HILITED:
|
||||
ic->norm.hilited = CreateImageState();
|
||||
ic->norm.hilited->im_file = duplicate(s2);
|
||||
ic->norm.hilited->im_file = Estrdup(s2);
|
||||
ICToRead = ic->norm.hilited;
|
||||
break;
|
||||
case ICLASS_DISABLED:
|
||||
ic->norm.disabled = CreateImageState();
|
||||
ic->norm.disabled->im_file = duplicate(s2);
|
||||
ic->norm.disabled->im_file = Estrdup(s2);
|
||||
ICToRead = ic->norm.disabled;
|
||||
break;
|
||||
case ICLASS_STICKY_NORMAL:
|
||||
ic->sticky.normal = CreateImageState();
|
||||
ic->sticky.normal->im_file = duplicate(s2);
|
||||
ic->sticky.normal->im_file = Estrdup(s2);
|
||||
ICToRead = ic->sticky.normal;
|
||||
break;
|
||||
case ICLASS_STICKY_CLICKED:
|
||||
ic->sticky.clicked = CreateImageState();
|
||||
ic->sticky.clicked->im_file = duplicate(s2);
|
||||
ic->sticky.clicked->im_file = Estrdup(s2);
|
||||
ICToRead = ic->sticky.clicked;
|
||||
break;
|
||||
case ICLASS_STICKY_HILITED:
|
||||
ic->sticky.hilited = CreateImageState();
|
||||
ic->sticky.hilited->im_file = duplicate(s2);
|
||||
ic->sticky.hilited->im_file = Estrdup(s2);
|
||||
ICToRead = ic->sticky.hilited;
|
||||
break;
|
||||
case ICLASS_STICKY_DISABLED:
|
||||
ic->sticky.disabled = CreateImageState();
|
||||
ic->sticky.disabled->im_file = duplicate(s2);
|
||||
ic->sticky.disabled->im_file = Estrdup(s2);
|
||||
ICToRead = ic->sticky.disabled;
|
||||
break;
|
||||
case ICLASS_ACTIVE_NORMAL:
|
||||
ic->active.normal = CreateImageState();
|
||||
ic->active.normal->im_file = duplicate(s2);
|
||||
ic->active.normal->im_file = Estrdup(s2);
|
||||
ICToRead = ic->active.normal;
|
||||
break;
|
||||
case ICLASS_ACTIVE_CLICKED:
|
||||
ic->active.clicked = CreateImageState();
|
||||
ic->active.clicked->im_file = duplicate(s2);
|
||||
ic->active.clicked->im_file = Estrdup(s2);
|
||||
ICToRead = ic->active.clicked;
|
||||
break;
|
||||
case ICLASS_ACTIVE_HILITED:
|
||||
ic->active.hilited = CreateImageState();
|
||||
ic->active.hilited->im_file = duplicate(s2);
|
||||
ic->active.hilited->im_file = Estrdup(s2);
|
||||
ICToRead = ic->active.hilited;
|
||||
break;
|
||||
case ICLASS_ACTIVE_DISABLED:
|
||||
ic->active.disabled = CreateImageState();
|
||||
ic->active.disabled->im_file = duplicate(s2);
|
||||
ic->active.disabled->im_file = Estrdup(s2);
|
||||
ICToRead = ic->active.disabled;
|
||||
break;
|
||||
case ICLASS_STICKY_ACTIVE_NORMAL:
|
||||
ic->sticky_active.normal = CreateImageState();
|
||||
ic->sticky_active.normal->im_file = duplicate(s2);
|
||||
ic->sticky_active.normal->im_file = Estrdup(s2);
|
||||
ICToRead = ic->sticky_active.normal;
|
||||
break;
|
||||
case ICLASS_STICKY_ACTIVE_CLICKED:
|
||||
ic->sticky_active.clicked = CreateImageState();
|
||||
ic->sticky_active.clicked->im_file = duplicate(s2);
|
||||
ic->sticky_active.clicked->im_file = Estrdup(s2);
|
||||
ICToRead = ic->sticky_active.clicked;
|
||||
break;
|
||||
case ICLASS_STICKY_ACTIVE_HILITED:
|
||||
ic->sticky_active.hilited = CreateImageState();
|
||||
ic->sticky_active.hilited->im_file = duplicate(s2);
|
||||
ic->sticky_active.hilited->im_file = Estrdup(s2);
|
||||
ICToRead = ic->sticky_active.hilited;
|
||||
break;
|
||||
case ICLASS_STICKY_ACTIVE_DISABLED:
|
||||
ic->sticky_active.disabled = CreateImageState();
|
||||
ic->sticky_active.disabled->im_file = duplicate(s2);
|
||||
ic->sticky_active.disabled->im_file = Estrdup(s2);
|
||||
ICToRead = ic->sticky_active.disabled;
|
||||
break;
|
||||
default:
|
||||
|
@ -2628,7 +2628,7 @@ Config_ColorModifier(FILE * ConfigFile)
|
|||
return;
|
||||
case CONFIG_CLASSNAME:
|
||||
SKIP_If_EXISTS(s2, LIST_TYPE_COLORMODIFIER);
|
||||
name = duplicate(s2);
|
||||
name = Estrdup(s2);
|
||||
break;
|
||||
case COLORMOD_RED:
|
||||
params = atword(s, 2);
|
||||
|
@ -2870,7 +2870,7 @@ Config_ToolTip(FILE * ConfigFile)
|
|||
return;
|
||||
case CONFIG_CLASSNAME:
|
||||
SKIP_If_EXISTS(s2, LIST_TYPE_TOOLTIP);
|
||||
name = duplicate(s2);
|
||||
name = Estrdup(s2);
|
||||
break;
|
||||
case TOOLTIP_DRAWICLASS:
|
||||
case CONFIG_IMAGECLASS:
|
||||
|
@ -3147,13 +3147,13 @@ Config_WindowMatch(FILE * ConfigFile)
|
|||
bm->border->ref_count++;
|
||||
break;
|
||||
case WINDOWMATCH_MATCHNAME:
|
||||
bm->win_name = duplicate(atword(s, 2));
|
||||
bm->win_name = Estrdup(atword(s, 2));
|
||||
break;
|
||||
case WINDOWMATCH_MATCHCLASS:
|
||||
bm->win_class = duplicate(atword(s, 2));
|
||||
bm->win_class = Estrdup(atword(s, 2));
|
||||
break;
|
||||
case WINDOWMATCH_MATCHTITLE:
|
||||
bm->win_title = duplicate(atword(s, 2));
|
||||
bm->win_title = Estrdup(atword(s, 2));
|
||||
break;
|
||||
case WINDOWMATCH_DESKTOP:
|
||||
case CONFIG_DESKTOP:
|
||||
|
@ -3252,7 +3252,7 @@ OpenConfigFileForReading(char *path, char preprocess)
|
|||
def_user = username(getuid());
|
||||
def_shell = usershell(getuid());
|
||||
|
||||
s = duplicate(path);
|
||||
s = Estrdup(path);
|
||||
while (s[i])
|
||||
{
|
||||
if (s[i] == '/')
|
||||
|
@ -3485,24 +3485,24 @@ FindFile(const char *file)
|
|||
{
|
||||
strcpy(s, file);
|
||||
if (findLocalizedFile(s) || isfile(s))
|
||||
EDBUG_RETURN(duplicate(s));
|
||||
EDBUG_RETURN(Estrdup(s));
|
||||
}
|
||||
|
||||
/* look in ~/.enlightenment first */
|
||||
|
||||
Esnprintf(s, sizeof(s), "%s/%s", EDirUser(), file);
|
||||
if (findLocalizedFile(s) || isfile(s))
|
||||
EDBUG_RETURN(duplicate(s));
|
||||
EDBUG_RETURN(Estrdup(s));
|
||||
|
||||
/* look in theme dir */
|
||||
Esnprintf(s, sizeof(s), "%s/%s", themepath, file);
|
||||
if (findLocalizedFile(s) || isfile(s))
|
||||
EDBUG_RETURN(duplicate(s));
|
||||
EDBUG_RETURN(Estrdup(s));
|
||||
|
||||
/* look in system config dir */
|
||||
Esnprintf(s, sizeof(s), "%s/config/%s", EDirRoot(), file);
|
||||
if (findLocalizedFile(s) || isfile(s))
|
||||
EDBUG_RETURN(duplicate(s));
|
||||
EDBUG_RETURN(Estrdup(s));
|
||||
|
||||
/* not found.... NULL */
|
||||
EDBUG_RETURN(NULL);
|
||||
|
@ -3520,18 +3520,18 @@ FindNoThemeFile(const char *file)
|
|||
{
|
||||
strcpy(s, file);
|
||||
if (findLocalizedFile(s) || isfile(s))
|
||||
EDBUG_RETURN(duplicate(s));
|
||||
EDBUG_RETURN(Estrdup(s));
|
||||
}
|
||||
|
||||
/* look in ~/.enlightenment first */
|
||||
Esnprintf(s, sizeof(s), "%s/%s", EDirUser(), file);
|
||||
if (findLocalizedFile(s) || isfile(s))
|
||||
EDBUG_RETURN(duplicate(s));
|
||||
EDBUG_RETURN(Estrdup(s));
|
||||
|
||||
/* look in system config dir */
|
||||
Esnprintf(s, sizeof(s), "%s/config/%s", EDirRoot(), file);
|
||||
if (findLocalizedFile(s) || isfile(s))
|
||||
EDBUG_RETURN(duplicate(s));
|
||||
EDBUG_RETURN(Estrdup(s));
|
||||
|
||||
/* not found.... NULL */
|
||||
EDBUG_RETURN(NULL);
|
||||
|
|
|
@ -72,8 +72,8 @@ CreateECursor(char *name, char *image, int native_id, XColor * fg, XColor * bg)
|
|||
}
|
||||
|
||||
ec = Emalloc(sizeof(ECursor));
|
||||
ec->name = duplicate(name);
|
||||
ec->file = duplicate(image);
|
||||
ec->name = Estrdup(name);
|
||||
ec->file = Estrdup(image);
|
||||
#if 0 /* Not used */
|
||||
ec->fg = *fg;
|
||||
ec->bg = *bg;
|
||||
|
|
|
@ -109,7 +109,7 @@ GetUniqueBGString(Background * bg)
|
|||
chmap[(f6 >> 0) & 0x3f], chmap[(f6 >> 6) & 0x3f],
|
||||
chmap[(f6 >> 12) & 0x3f], chmap[(f6 >> 18) & 0x3f],
|
||||
chmap[(f6 >> 24) & 0x3f], chmap[(f6 >> 28) & 0x3f]);
|
||||
return duplicate(s);
|
||||
return Estrdup(s);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -397,7 +397,7 @@ CreateDesktopBG(char *name, XColor * solid, char *bg, char tile,
|
|||
d = Emalloc(sizeof(Background));
|
||||
if (!d)
|
||||
EDBUG_RETURN(NULL);
|
||||
d->name = duplicate(name);
|
||||
d->name = Estrdup(name);
|
||||
d->pmap = 0;
|
||||
d->last_viewed = 0;
|
||||
|
||||
|
@ -406,7 +406,7 @@ CreateDesktopBG(char *name, XColor * solid, char *bg, char tile,
|
|||
d->bg_solid = *solid;
|
||||
d->bg.file = NULL;
|
||||
if (bg)
|
||||
d->bg.file = duplicate(bg);
|
||||
d->bg.file = Estrdup(bg);
|
||||
d->bg.real_file = NULL;
|
||||
d->bg.im = NULL;
|
||||
d->bg_tile = tile;
|
||||
|
@ -418,7 +418,7 @@ CreateDesktopBG(char *name, XColor * solid, char *bg, char tile,
|
|||
|
||||
d->top.file = NULL;
|
||||
if (top)
|
||||
d->top.file = duplicate(top);
|
||||
d->top.file = Estrdup(top);
|
||||
d->top.real_file = NULL;
|
||||
d->top.im = NULL;
|
||||
d->top.keep_aspect = tkeep_aspect;
|
||||
|
@ -828,33 +828,33 @@ InitDesktopControls()
|
|||
a = CreateAction(EVENT_MOUSE_DOWN, 0, 0, 0, 3, 0, NULL, NULL);
|
||||
AddAction(ac, a);
|
||||
Esnprintf(s, sizeof(s), "deskmenu");
|
||||
AddToAction(a, ACTION_SHOW_MENU, duplicate(s));
|
||||
AddToAction(a, ACTION_SHOW_MENU, Estrdup(s));
|
||||
a = CreateAction(EVENT_MOUSE_DOWN, 0, 0, 0, 2, 0, NULL, NULL);
|
||||
AddAction(ac, a);
|
||||
Esnprintf(s, sizeof(s), "taskmenu");
|
||||
AddToAction(a, ACTION_SHOW_MENU, duplicate(s));
|
||||
AddToAction(a, ACTION_SHOW_MENU, Estrdup(s));
|
||||
if (i > 0)
|
||||
{
|
||||
ac->tooltipstring =
|
||||
duplicate(_
|
||||
("Hold down the mouse button and drag\n"
|
||||
"the mouse to be able to drag the desktop\n"
|
||||
"back and forth.\n"
|
||||
"Click right mouse button for a list of all\n"
|
||||
"Desktops and their applications.\n"
|
||||
"Click middle mouse button for a list of all\n"
|
||||
"applications currently running.\n"));
|
||||
Estrdup(_
|
||||
("Hold down the mouse button and drag\n"
|
||||
"the mouse to be able to drag the desktop\n"
|
||||
"back and forth.\n"
|
||||
"Click right mouse button for a list of all\n"
|
||||
"Desktops and their applications.\n"
|
||||
"Click middle mouse button for a list of all\n"
|
||||
"applications currently running.\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
ac->tooltipstring =
|
||||
duplicate(_
|
||||
("This is the Root desktop.\n"
|
||||
"You cannot drag the root desktop around.\n"
|
||||
"Click right mouse button for a list of all\n"
|
||||
"Desktops and their applications.\n"
|
||||
"Click middle mouse button for a list of all\n"
|
||||
"applications currently running.\n"));
|
||||
Estrdup(_
|
||||
("This is the Root desktop.\n"
|
||||
"You cannot drag the root desktop around.\n"
|
||||
"Click right mouse button for a list of all\n"
|
||||
"Desktops and their applications.\n"
|
||||
"Click middle mouse button for a list of all\n"
|
||||
"applications currently running.\n"));
|
||||
}
|
||||
}
|
||||
Esnprintf(s, sizeof(s), "RAISEBUTTON_DESKTOP_%i", i);
|
||||
|
@ -869,9 +869,8 @@ InitDesktopControls()
|
|||
Esnprintf(param, 3, "%i", i);
|
||||
AddToAction(a, ACTION_DESKTOP_RAISE, param);
|
||||
ac2->tooltipstring =
|
||||
duplicate(_
|
||||
("Click here to raise this desktop\n"
|
||||
"to the top.\n"));
|
||||
Estrdup(_
|
||||
("Click here to raise this desktop\n" "to the top.\n"));
|
||||
}
|
||||
Esnprintf(s, sizeof(s), "LOWERBUTTON_DESKTOP_%i", i);
|
||||
ac3 = FindItem(s, 0, LIST_FINDBY_NAME, LIST_TYPE_ACLASS);
|
||||
|
@ -885,9 +884,9 @@ InitDesktopControls()
|
|||
Esnprintf(param, 3, "%i", i);
|
||||
AddToAction(a, ACTION_DESKTOP_LOWER, param);
|
||||
ac3->tooltipstring =
|
||||
duplicate(_
|
||||
("Click here to lower this desktop\n"
|
||||
"to the bottom.\n"));
|
||||
Estrdup(_
|
||||
("Click here to lower this desktop\n"
|
||||
"to the bottom.\n"));
|
||||
}
|
||||
b = NULL;
|
||||
|
||||
|
|
20
src/dialog.c
20
src/dialog.c
|
@ -212,7 +212,7 @@ DialogRealizeTClassDefault(void)
|
|||
d_tc_default = CreateTclass();
|
||||
d_tc_default->norm.normal = CreateTextState();
|
||||
d_tc_default->norm.normal->fontname =
|
||||
duplicate("-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*");
|
||||
Estrdup("-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*");
|
||||
ESetColor(&(d_tc_default->norm.normal->fg_col), 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
@ -304,7 +304,7 @@ DialogCreate(char *name)
|
|||
Dialog *d;
|
||||
|
||||
d = Emalloc(sizeof(Dialog));
|
||||
d->name = duplicate(name);
|
||||
d->name = Estrdup(name);
|
||||
d->title = NULL;
|
||||
d->text = NULL;
|
||||
d->num_buttons = 0;
|
||||
|
@ -386,7 +386,7 @@ DialogSetText(Dialog * d, const char *text)
|
|||
if (d->text)
|
||||
Efree(d->text);
|
||||
|
||||
d->text = duplicate(text);
|
||||
d->text = Estrdup(text);
|
||||
if ((!d->tclass) || (!d->iclass))
|
||||
return;
|
||||
TextSize(d->tclass, 0, 0, STATE_NORMAL, text, &w, &h, 17);
|
||||
|
@ -399,7 +399,7 @@ DialogSetTitle(Dialog * d, const char *title)
|
|||
{
|
||||
if (d->title)
|
||||
Efree(d->title);
|
||||
d->title = duplicate(title);
|
||||
d->title = Estrdup(title);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -422,7 +422,7 @@ DialogAddButton(Dialog * d, char *text, void (*func) (int val, void *data),
|
|||
d->num_buttons++;
|
||||
d->button = Erealloc(d->button, d->num_buttons * (sizeof(DButton *)));
|
||||
d->button[d->num_buttons - 1] = db;
|
||||
db->text = duplicate(text);
|
||||
db->text = Estrdup(text);
|
||||
db->func = func;
|
||||
db->win = ECreateWindow(d->win, -20, -20, 2, 2, 0);
|
||||
EMapWindow(disp, db->win);
|
||||
|
@ -1804,7 +1804,7 @@ DialogItemButtonSetText(DItem * di, char *text)
|
|||
{
|
||||
if (di->item.button.text)
|
||||
Efree(di->item.button.text);
|
||||
di->item.button.text = duplicate(text);
|
||||
di->item.button.text = Estrdup(text);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1812,7 +1812,7 @@ DialogItemCheckButtonSetText(DItem * di, char *text)
|
|||
{
|
||||
if (di->item.check_button.text)
|
||||
Efree(di->item.check_button.text);
|
||||
di->item.check_button.text = duplicate(text);
|
||||
di->item.check_button.text = Estrdup(text);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1820,7 +1820,7 @@ DialogItemTextSetText(DItem * di, char *text)
|
|||
{
|
||||
if (di->item.text.text)
|
||||
Efree(di->item.text.text);
|
||||
di->item.text.text = duplicate(text);
|
||||
di->item.text.text = Estrdup(text);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1835,7 +1835,7 @@ DialogItemRadioButtonSetText(DItem * di, char *text)
|
|||
{
|
||||
if (di->item.radio_button.text)
|
||||
Efree(di->item.radio_button.text);
|
||||
di->item.radio_button.text = duplicate(text);
|
||||
di->item.radio_button.text = Estrdup(text);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1900,7 +1900,7 @@ DialogItemImageSetFile(DItem * di, char *image)
|
|||
{
|
||||
if (di->item.image.image)
|
||||
Efree(di->item.image.image);
|
||||
di->item.image.image = duplicate(image);
|
||||
di->item.image.image = Estrdup(image);
|
||||
di->fill_h = 0;
|
||||
di->fill_v = 0;
|
||||
}
|
||||
|
|
56
src/file.c
56
src/file.c
|
@ -172,7 +172,7 @@ ls(const char *dir, int *num)
|
|||
break;
|
||||
if ((strcmp(dp->d_name, ".")) && (strcmp(dp->d_name, "..")))
|
||||
{
|
||||
names[i] = duplicate(dp->d_name);
|
||||
names[i] = Estrdup(dp->d_name);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
@ -335,7 +335,7 @@ cwd(void)
|
|||
|
||||
EDBUG(9, "cwd");
|
||||
getcwd(ss, FILEPATH_LEN_MAX);
|
||||
s = duplicate(ss);
|
||||
s = Estrdup(ss);
|
||||
EDBUG_RETURN(s);
|
||||
}
|
||||
|
||||
|
@ -390,16 +390,16 @@ username(int uid)
|
|||
if (usr_uid < 0)
|
||||
usr_uid = getuid();
|
||||
if ((uid == usr_uid) && (usr_s))
|
||||
EDBUG_RETURN(duplicate(usr_s));
|
||||
EDBUG_RETURN(Estrdup(usr_s));
|
||||
pwd = getpwuid(uid);
|
||||
if (pwd)
|
||||
{
|
||||
s = duplicate(pwd->pw_name);
|
||||
s = Estrdup(pwd->pw_name);
|
||||
if (uid == usr_uid)
|
||||
usr_s = duplicate(s);
|
||||
usr_s = Estrdup(s);
|
||||
EDBUG_RETURN(s);
|
||||
}
|
||||
EDBUG_RETURN(duplicate("unknown"));
|
||||
EDBUG_RETURN(Estrdup("unknown"));
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -415,18 +415,18 @@ homedir(int uid)
|
|||
usr_uid = getuid();
|
||||
if ((uid == usr_uid) && (usr_s))
|
||||
{
|
||||
EDBUG_RETURN(duplicate(usr_s));
|
||||
EDBUG_RETURN(Estrdup(usr_s));
|
||||
}
|
||||
pwd = getpwuid(uid);
|
||||
if (pwd)
|
||||
{
|
||||
s = duplicate(pwd->pw_dir);
|
||||
s = Estrdup(pwd->pw_dir);
|
||||
if (uid == usr_uid)
|
||||
usr_s = duplicate(s);
|
||||
usr_s = Estrdup(s);
|
||||
EDBUG_RETURN(s);
|
||||
}
|
||||
EDBUG_RETURN(duplicate((getenv("TMPDIR") == NULL) ?
|
||||
"/tmp" : getenv("TMPDIR")));
|
||||
EDBUG_RETURN(Estrdup((getenv("TMPDIR") == NULL) ?
|
||||
"/tmp" : getenv("TMPDIR")));
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -441,22 +441,22 @@ usershell(int uid)
|
|||
if (usr_uid < 0)
|
||||
usr_uid = getuid();
|
||||
if ((uid == usr_uid) && (usr_s))
|
||||
return duplicate(usr_s);
|
||||
return Estrdup(usr_s);
|
||||
pwd = getpwuid(uid);
|
||||
if (pwd)
|
||||
{
|
||||
if (!pwd->pw_shell)
|
||||
EDBUG_RETURN(duplicate("/bin/sh"));
|
||||
EDBUG_RETURN(Estrdup("/bin/sh"));
|
||||
if (strlen(pwd->pw_shell) < 1)
|
||||
EDBUG_RETURN(duplicate("/bin/sh"));
|
||||
EDBUG_RETURN(Estrdup("/bin/sh"));
|
||||
if (!(canexec(pwd->pw_shell)))
|
||||
EDBUG_RETURN(duplicate("/bin/sh"));
|
||||
s = duplicate(pwd->pw_shell);
|
||||
EDBUG_RETURN(Estrdup("/bin/sh"));
|
||||
s = Estrdup(pwd->pw_shell);
|
||||
if (uid == usr_uid)
|
||||
usr_s = duplicate(s);
|
||||
usr_s = Estrdup(s);
|
||||
EDBUG_RETURN(s);
|
||||
}
|
||||
EDBUG_RETURN(duplicate("/bin/sh"));
|
||||
EDBUG_RETURN(Estrdup("/bin/sh"));
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -738,7 +738,7 @@ field(char *s, int field)
|
|||
{
|
||||
if ((!strcmp(buf, "NULL")) || (!strcmp(buf, "(null)")))
|
||||
EDBUG_RETURN(NULL);
|
||||
EDBUG_RETURN(duplicate(buf));
|
||||
EDBUG_RETURN(Estrdup(buf));
|
||||
}
|
||||
EDBUG_RETURN(NULL);
|
||||
}
|
||||
|
@ -824,11 +824,11 @@ fileof(const char *s)
|
|||
if (p1 < 0)
|
||||
p1 = 0;
|
||||
if (p2 <= 0)
|
||||
EDBUG_RETURN(duplicate(""));
|
||||
EDBUG_RETURN(Estrdup(""));
|
||||
for (i = 0; i <= (p2 - p1); i++)
|
||||
ss[i] = s[p1 + i];
|
||||
ss[i] = 0;
|
||||
EDBUG_RETURN(duplicate(ss));
|
||||
EDBUG_RETURN(Estrdup(ss));
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -851,7 +851,7 @@ fullfileof(const char *s)
|
|||
for (i = 0; i < (p2 - p1); i++)
|
||||
ss[i] = s[p1 + i];
|
||||
ss[i] = 0;
|
||||
EDBUG_RETURN(duplicate(ss));
|
||||
EDBUG_RETURN(Estrdup(ss));
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -866,12 +866,12 @@ pathtoexec(const char *file)
|
|||
if (isabspath(file))
|
||||
{
|
||||
if (canexec(file))
|
||||
EDBUG_RETURN(duplicate(file));
|
||||
EDBUG_RETURN(Estrdup(file));
|
||||
EDBUG_RETURN(NULL);
|
||||
}
|
||||
p = getenv("PATH");
|
||||
if (!p)
|
||||
EDBUG_RETURN(duplicate(file));
|
||||
EDBUG_RETURN(Estrdup(file));
|
||||
if (!file)
|
||||
EDBUG_RETURN(NULL);
|
||||
|
||||
|
@ -922,11 +922,11 @@ pathtofile(const char *file)
|
|||
if (isabspath(file))
|
||||
{
|
||||
if (exists(file))
|
||||
EDBUG_RETURN(duplicate(file));
|
||||
EDBUG_RETURN(Estrdup(file));
|
||||
}
|
||||
p = getenv("PATH");
|
||||
if (!p)
|
||||
EDBUG_RETURN(duplicate(file));
|
||||
EDBUG_RETURN(Estrdup(file));
|
||||
if (!file)
|
||||
EDBUG_RETURN(NULL);
|
||||
cp = p;
|
||||
|
@ -973,8 +973,8 @@ findLocalizedFile(char *fname)
|
|||
if (!(lang = setlocale(LC_MESSAGES, NULL)))
|
||||
return 0;
|
||||
|
||||
tmp = strdup(fname);
|
||||
lang = strdup(lang); /* lang may be in static space, thus it must
|
||||
tmp = Estrdup(fname);
|
||||
lang = Estrdup(lang); /* lang may be in static space, thus it must
|
||||
* * * be duplicated before we change it below */
|
||||
p[0] = lang + strlen(lang);
|
||||
p[1] = strchr(lang, '.');
|
||||
|
|
4
src/fx.c
4
src/fx.c
|
@ -201,7 +201,7 @@ FX_Active(int *num)
|
|||
(*num)++;
|
||||
list = Erealloc(list, sizeof(char *) * (*num));
|
||||
|
||||
list[(*num) - 1] = duplicate(fx_handlers[i].name);
|
||||
list[(*num) - 1] = Estrdup(fx_handlers[i].name);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
|
@ -952,7 +952,7 @@ FX_ImageSpinner_Init(const char *name)
|
|||
{
|
||||
fx_imagespinner_count = 3;
|
||||
DoIn("FX_IMAGESPINNER_TIMEOUT", 0.066, FX_imagespinner_timeout, 0, NULL);
|
||||
fx_imagespinner_params = duplicate(name);
|
||||
fx_imagespinner_params = Estrdup(name);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -651,7 +651,7 @@ GNOME_SetDeskNames(void)
|
|||
for (i = 0; i < conf.desks.num; i++)
|
||||
{
|
||||
Esnprintf(s, sizeof(s), "%i", i);
|
||||
names[i] = duplicate(s);
|
||||
names[i] = Estrdup(s);
|
||||
}
|
||||
if (XStringListToTextProperty(names, conf.desks.num, &text))
|
||||
{
|
||||
|
|
32
src/icccm.c
32
src/icccm.c
|
@ -111,23 +111,23 @@ ICCCM_GetTitle(EWin * ewin, Atom atom_change)
|
|||
s = XmbTextPropertyToTextList(disp, &xtp, &list, &items);
|
||||
if ((s == Success) && (items > 0))
|
||||
{
|
||||
ewin->client.title = duplicate(*list);
|
||||
ewin->client.title = Estrdup(*list);
|
||||
XFreeStringList(list);
|
||||
}
|
||||
else
|
||||
{
|
||||
ewin->client.title = duplicate((char *)xtp.value);
|
||||
ewin->client.title = Estrdup((char *)xtp.value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ewin->client.title = duplicate((char *)xtp.value);
|
||||
ewin->client.title = Estrdup((char *)xtp.value);
|
||||
}
|
||||
XFree(xtp.value);
|
||||
}
|
||||
else if (!ewin->internal)
|
||||
{
|
||||
ewin->client.title = duplicate("No Title");
|
||||
ewin->client.title = Estrdup("No Title");
|
||||
}
|
||||
|
||||
EDBUG_RETURN_;
|
||||
|
@ -742,8 +742,8 @@ ICCCM_GetInfo(EWin * ewin, Atom atom_change)
|
|||
Efree(ewin->client.name);
|
||||
if (ewin->client.class)
|
||||
Efree(ewin->client.class);
|
||||
ewin->client.name = duplicate(hint.res_name);
|
||||
ewin->client.class = duplicate(hint.res_class);
|
||||
ewin->client.name = Estrdup(hint.res_name);
|
||||
ewin->client.class = Estrdup(hint.res_class);
|
||||
XFree(hint.res_name);
|
||||
XFree(hint.res_class);
|
||||
}
|
||||
|
@ -753,8 +753,8 @@ ICCCM_GetInfo(EWin * ewin, Atom atom_change)
|
|||
Efree(ewin->client.name);
|
||||
if (ewin->client.class)
|
||||
Efree(ewin->client.class);
|
||||
ewin->client.name = duplicate(hint.res_name);
|
||||
ewin->client.class = duplicate(hint.res_class);
|
||||
ewin->client.name = Estrdup(hint.res_name);
|
||||
ewin->client.class = Estrdup(hint.res_class);
|
||||
XFree(hint.res_name);
|
||||
XFree(hint.res_class);
|
||||
}
|
||||
|
@ -851,14 +851,14 @@ ICCCM_GetInfo(EWin * ewin, Atom atom_change)
|
|||
{
|
||||
if (ewin->client.machine)
|
||||
Efree(ewin->client.machine);
|
||||
ewin->client.machine = duplicate((char *)xtp.value);
|
||||
ewin->client.machine = Estrdup((char *)xtp.value);
|
||||
XFree(xtp.value);
|
||||
}
|
||||
else if (XGetWMClientMachine(disp, ewin->client.group, &xtp))
|
||||
{
|
||||
if (ewin->client.machine)
|
||||
Efree(ewin->client.machine);
|
||||
ewin->client.machine = duplicate((char *)xtp.value);
|
||||
ewin->client.machine = Estrdup((char *)xtp.value);
|
||||
XFree(xtp.value);
|
||||
}
|
||||
else
|
||||
|
@ -875,7 +875,7 @@ ICCCM_GetInfo(EWin * ewin, Atom atom_change)
|
|||
Efree(ewin->client.icon_name);
|
||||
if (xtp.encoding == XA_STRING)
|
||||
{
|
||||
ewin->client.icon_name = duplicate((char *)xtp.value);
|
||||
ewin->client.icon_name = Estrdup((char *)xtp.value);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -886,11 +886,11 @@ ICCCM_GetInfo(EWin * ewin, Atom atom_change)
|
|||
status = XmbTextPropertyToTextList(disp, &xtp, &cl, &n);
|
||||
if (status >= Success && n > 0 && cl[0])
|
||||
{
|
||||
ewin->client.icon_name = duplicate(cl[0]);
|
||||
ewin->client.icon_name = Estrdup(cl[0]);
|
||||
XFreeStringList(cl);
|
||||
}
|
||||
else
|
||||
ewin->client.icon_name = duplicate((char *)xtp.value);
|
||||
ewin->client.icon_name = Estrdup((char *)xtp.value);
|
||||
}
|
||||
XFree(xtp.value);
|
||||
}
|
||||
|
@ -900,7 +900,7 @@ ICCCM_GetInfo(EWin * ewin, Atom atom_change)
|
|||
Efree(ewin->client.icon_name);
|
||||
if (xtp.encoding == XA_STRING)
|
||||
{
|
||||
ewin->client.icon_name = duplicate((char *)xtp.value);
|
||||
ewin->client.icon_name = Estrdup((char *)xtp.value);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -911,11 +911,11 @@ ICCCM_GetInfo(EWin * ewin, Atom atom_change)
|
|||
status = XmbTextPropertyToTextList(disp, &xtp, &cl, &n);
|
||||
if (status >= Success && n > 0 && cl[0])
|
||||
{
|
||||
ewin->client.icon_name = duplicate(cl[0]);
|
||||
ewin->client.icon_name = Estrdup(cl[0]);
|
||||
XFreeStringList(cl);
|
||||
}
|
||||
else
|
||||
ewin->client.icon_name = duplicate((char *)xtp.value);
|
||||
ewin->client.icon_name = Estrdup((char *)xtp.value);
|
||||
}
|
||||
XFree(xtp.value);
|
||||
}
|
||||
|
|
|
@ -382,7 +382,7 @@ IconboxCreate(char *name)
|
|||
Iconbox *ib;
|
||||
|
||||
ib = Emalloc(sizeof(Iconbox));
|
||||
ib->name = duplicate(name);
|
||||
ib->name = Estrdup(name);
|
||||
ib->orientation = 0;
|
||||
ib->scrollbar_side = 1;
|
||||
ib->arrow_side = 1;
|
||||
|
@ -905,10 +905,10 @@ IB_AddIcondef(char *title, char *name, char *class, char *file)
|
|||
idef = Emalloc(sizeof(Icondef));
|
||||
if (!idef)
|
||||
return;
|
||||
idef->title_match = duplicate(title);
|
||||
idef->name_match = duplicate(name);
|
||||
idef->class_match = duplicate(class);
|
||||
idef->icon_file = duplicate(file);
|
||||
idef->title_match = Estrdup(title);
|
||||
idef->name_match = Estrdup(name);
|
||||
idef->class_match = Estrdup(class);
|
||||
idef->icon_file = Estrdup(file);
|
||||
AddItem(idef, "", 0, LIST_TYPE_ICONDEF);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ SetupFallbackClasses(void)
|
|||
|
||||
/* create a fallback imageclass in case no imageclass can be found */
|
||||
ic = CreateIclass();
|
||||
ic->name = duplicate("__FALLBACK_ICLASS");
|
||||
ic->name = Estrdup("__FALLBACK_ICLASS");
|
||||
ic->norm.normal = CreateImageState();
|
||||
ESetColor(&(ic->norm.normal->hihi), 255, 255, 255);
|
||||
ESetColor(&(ic->norm.normal->hi), 255, 255, 255);
|
||||
|
@ -136,7 +136,7 @@ SetupFallbackClasses(void)
|
|||
tc->name = "__FALLBACK_TCLASS";
|
||||
tc->norm.normal = CreateTextState();
|
||||
tc->norm.normal->fontname =
|
||||
duplicate("-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*");
|
||||
Estrdup("-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*");
|
||||
ESetColor(&(tc->norm.normal->fg_col), 0, 0, 0);
|
||||
AddItem(tc, tc->name, 0, LIST_TYPE_TCLASS);
|
||||
|
||||
|
|
|
@ -1075,7 +1075,7 @@ IPC_Background(char *params, Client * c)
|
|||
|
||||
if (!bg)
|
||||
{
|
||||
bg = CreateDesktopBG(strdup(name), NULL, NULL, 0, 0, 0,
|
||||
bg = CreateDesktopBG(Estrdup(name), NULL, NULL, 0, 0, 0,
|
||||
0, 0, 0, NULL, 0, 0, 0, 0, 0);
|
||||
AddItem(bg, bg->name, 0, LIST_TYPE_BACKGROUND);
|
||||
}
|
||||
|
@ -1105,7 +1105,7 @@ IPC_Background(char *params, Client * c)
|
|||
{
|
||||
if (bg->bg.file)
|
||||
Efree(bg->bg.file);
|
||||
bg->bg.file = strdup(valu);
|
||||
bg->bg.file = Estrdup(valu);
|
||||
}
|
||||
else if (!strcmp(type, "bg.tile"))
|
||||
{
|
||||
|
@ -1135,7 +1135,7 @@ IPC_Background(char *params, Client * c)
|
|||
{
|
||||
if (bg->top.file)
|
||||
Efree(bg->top.file);
|
||||
bg->top.file = strdup(valu);
|
||||
bg->top.file = Estrdup(valu);
|
||||
}
|
||||
else if (!strcmp(type, "top.keep_aspect"))
|
||||
{
|
||||
|
|
|
@ -85,7 +85,7 @@ AddItem(void *item, const char *name, int id, int type)
|
|||
if (!ptr)
|
||||
EDBUG_RETURN_;
|
||||
ptr->item = item;
|
||||
ptr->name = duplicate(name);
|
||||
ptr->name = Estrdup(name);
|
||||
ptr->id = id;
|
||||
ptr->next = lists[type].next;
|
||||
lists[type].next = ptr;
|
||||
|
@ -102,7 +102,7 @@ AddItemEnd(void *item, const char *name, int id, int type)
|
|||
if (!ptr)
|
||||
EDBUG_RETURN_;
|
||||
ptr->item = item;
|
||||
ptr->name = duplicate(name);
|
||||
ptr->name = Estrdup(name);
|
||||
ptr->id = id;
|
||||
ptr->next = NULL;
|
||||
p = lists[type].next;
|
||||
|
@ -415,7 +415,7 @@ ListItems(int *num, int type)
|
|||
{
|
||||
while (ptr)
|
||||
{
|
||||
list[i] = duplicate(ptr->name);
|
||||
list[i] = Estrdup(ptr->name);
|
||||
i++;
|
||||
ptr = ptr->next;
|
||||
}
|
||||
|
@ -424,7 +424,7 @@ ListItems(int *num, int type)
|
|||
{
|
||||
while (ptr)
|
||||
{
|
||||
list[i] = duplicate(ptr->name);
|
||||
list[i] = Estrdup(ptr->name);
|
||||
i++;
|
||||
ptr = ptr->next;
|
||||
}
|
||||
|
|
|
@ -96,9 +96,9 @@ main(int argc, char **argv)
|
|||
srand(time(NULL));
|
||||
|
||||
if (!uname(&ubuf))
|
||||
e_machine_name = duplicate(ubuf.nodename);
|
||||
e_machine_name = Estrdup(ubuf.nodename);
|
||||
if (!e_machine_name)
|
||||
e_machine_name = duplicate("localhost");
|
||||
e_machine_name = Estrdup("localhost");
|
||||
|
||||
SetSMProgName(argv[0]);
|
||||
|
||||
|
|
20
src/memory.c
20
src/memory.c
|
@ -401,12 +401,12 @@ __Efree(void *ptr, const char *file, int line)
|
|||
|
||||
#if !(defined(USE_STRDUP) && defined(HAVE_STRDUP))
|
||||
char *
|
||||
duplicate(const char *s)
|
||||
Estrdup(const char *s)
|
||||
{
|
||||
char *ss;
|
||||
int sz;
|
||||
|
||||
EDBUG(9, "duplicate");
|
||||
EDBUG(9, "Estrdup");
|
||||
if (!s)
|
||||
EDBUG_RETURN(NULL);
|
||||
sz = strlen(s);
|
||||
|
@ -415,3 +415,19 @@ duplicate(const char *s)
|
|||
EDBUG_RETURN(ss);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !(defined(USE_STRDUP) && defined(HAVE_STRNDUP))
|
||||
char *
|
||||
Estrndup(const char *s, int n)
|
||||
{
|
||||
char *ss;
|
||||
|
||||
EDBUG(9, "Estrndup");
|
||||
if (!s)
|
||||
EDBUG_RETURN(NULL);
|
||||
ss = Emalloc(n + 1);
|
||||
strncpy(ss, s, n);
|
||||
ss[n] = '\0';
|
||||
EDBUG_RETURN(ss);
|
||||
}
|
||||
#endif
|
||||
|
|
26
src/menus.c
26
src/menus.c
|
@ -375,11 +375,11 @@ MenuItemCreate(char *text, ImageClass * iclass, int action_id,
|
|||
mi->icon_iclass = iclass;
|
||||
if (iclass)
|
||||
iclass->ref_count++;
|
||||
mi->text = duplicate(text);
|
||||
mi->text = Estrdup(text);
|
||||
mi->act_id = action_id;
|
||||
if (action_params)
|
||||
{
|
||||
mi->params = duplicate(action_params);
|
||||
mi->params = Estrdup(action_params);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -574,7 +574,7 @@ MenuAddName(Menu * menu, const char *name)
|
|||
EDBUG(5, "MenuAddName");
|
||||
if (menu->name)
|
||||
Efree(menu->name);
|
||||
menu->name = duplicate(name);
|
||||
menu->name = Estrdup(name);
|
||||
AddItem(menu, menu->name, menu->win, LIST_TYPE_MENU);
|
||||
EDBUG_RETURN_;
|
||||
}
|
||||
|
@ -585,7 +585,7 @@ MenuAddTitle(Menu * menu, const char *title)
|
|||
EDBUG(5, "MenuAddTitle");
|
||||
if (menu->title)
|
||||
Efree(menu->title);
|
||||
menu->title = duplicate(title);
|
||||
menu->title = Estrdup(title);
|
||||
EDBUG_RETURN_;
|
||||
}
|
||||
|
||||
|
@ -1102,11 +1102,11 @@ MenuCreateFromDirectory(char *name, MenuStyle * ms, char *dir)
|
|||
char stmp[4096];
|
||||
|
||||
ic = CreateIclass();
|
||||
ic->name = duplicate("`");
|
||||
ic->name = Estrdup("`");
|
||||
ic->norm.normal = CreateImageState();
|
||||
Esnprintf(stmp, sizeof(stmp), "%s/cached/img/%s",
|
||||
EDirUserCache(), s3);
|
||||
ic->norm.normal->im_file = duplicate(stmp);
|
||||
ic->norm.normal->im_file = Estrdup(stmp);
|
||||
ic->norm.normal->unloadable = 1;
|
||||
IclassPopulate(ic);
|
||||
AddItem(ic, ic->name, 0, LIST_TYPE_ICLASS);
|
||||
|
@ -1313,11 +1313,11 @@ MenuCreateFromDirectory(char *name, MenuStyle * ms, char *dir)
|
|||
char stmp[4096];
|
||||
|
||||
ic = CreateIclass();
|
||||
ic->name = duplicate("`");
|
||||
ic->name = Estrdup("`");
|
||||
ic->norm.normal = CreateImageState();
|
||||
Esnprintf(stmp, sizeof(stmp), "%s/cached/img/%s",
|
||||
EDirUserCache(), s3);
|
||||
ic->norm.normal->im_file = duplicate(stmp);
|
||||
ic->norm.normal->im_file = Estrdup(stmp);
|
||||
ic->norm.normal->unloadable = 1;
|
||||
IclassPopulate(ic);
|
||||
AddItem(ic, ic->name, 0, LIST_TYPE_ICLASS);
|
||||
|
@ -1433,7 +1433,7 @@ FillFlatFileMenu(Menu * m, MenuStyle * ms, char *name, char *file,
|
|||
if (!icc)
|
||||
{
|
||||
icc = CreateIclass();
|
||||
icc->name = duplicate(wd);
|
||||
icc->name = Estrdup(wd);
|
||||
icc->norm.normal = CreateImageState();
|
||||
icc->norm.normal->im_file = icon;
|
||||
IclassPopulate(icc);
|
||||
|
@ -1601,15 +1601,15 @@ MenuCreateFromGnome(char *name, MenuStyle * ms, char *dir)
|
|||
if (s[strlen(s) - 1] == '\n')
|
||||
s[strlen(s) - 1] = 0;
|
||||
if (!strncmp(s, "Name=", strlen("Name=")))
|
||||
en_name = duplicate(&(s[strlen("Name=")]));
|
||||
en_name = Estrdup(&(s[strlen("Name=")]));
|
||||
else if (name_buf[0]
|
||||
&& !strncmp(s, name_buf, strlen(name_buf)))
|
||||
iname = duplicate(&(s[strlen(name_buf)]));
|
||||
iname = Estrdup(&(s[strlen(name_buf)]));
|
||||
else if (!strncmp
|
||||
(s, "TryExec=", strlen("TryExec=")))
|
||||
texec = duplicate(&(s[strlen("TryExec=")]));
|
||||
texec = Estrdup(&(s[strlen("TryExec=")]));
|
||||
else if (!strncmp(s, "Exec=", strlen("Exec=")))
|
||||
exec = duplicate(&(s[strlen("Exec=")]));
|
||||
exec = Estrdup(&(s[strlen("Exec=")]));
|
||||
}
|
||||
if (iname)
|
||||
{
|
||||
|
|
|
@ -125,7 +125,7 @@ EDirRoot(void)
|
|||
void
|
||||
EDirUserSet(const char *d)
|
||||
{
|
||||
dir = duplicate(d);
|
||||
dir = Estrdup(d);
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -139,7 +139,7 @@ EDirUser(void)
|
|||
home = homedir(getuid());
|
||||
Esnprintf(buf, sizeof(buf), "%s/.enlightenment", home);
|
||||
Efree(home);
|
||||
dir = duplicate(buf);
|
||||
dir = Estrdup(buf);
|
||||
|
||||
return dir;
|
||||
}
|
||||
|
@ -147,14 +147,14 @@ EDirUser(void)
|
|||
void
|
||||
EDirUserCacheSet(const char *d)
|
||||
{
|
||||
cacheDir = duplicate(d);
|
||||
cacheDir = Estrdup(d);
|
||||
}
|
||||
|
||||
char *
|
||||
EDirUserCache(void)
|
||||
{
|
||||
if (!cacheDir)
|
||||
cacheDir = duplicate(EDirUser());
|
||||
cacheDir = Estrdup(EDirUser());
|
||||
return cacheDir;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ CreateProgressbar(char *name, int width, int height)
|
|||
pnum++;
|
||||
plist = Erealloc(plist, pnum * sizeof(Progressbar *));
|
||||
plist[pnum - 1] = p;
|
||||
p->name = duplicate(name);
|
||||
p->name = Estrdup(name);
|
||||
p->x = (root.w - width) / 2;
|
||||
p->y = 32 + (pnum * height * 2);
|
||||
p->w = width;
|
||||
|
|
|
@ -139,7 +139,7 @@ default_save_prefix(void)
|
|||
char s[1024];
|
||||
|
||||
Esnprintf(s, sizeof(s), "%s/...e_session-XXXXXX", EDirUser());
|
||||
def_prefix = duplicate(s);
|
||||
def_prefix = Estrdup(s);
|
||||
}
|
||||
return def_prefix;
|
||||
}
|
||||
|
@ -168,13 +168,13 @@ Match *matches = NULL;
|
|||
void
|
||||
SetSMProgName(const char *name)
|
||||
{
|
||||
command = duplicate(name);
|
||||
command = Estrdup(name);
|
||||
}
|
||||
|
||||
void
|
||||
SetSMUserThemePath(const char *path)
|
||||
{
|
||||
userthemepath = duplicate(path);
|
||||
userthemepath = Estrdup(path);
|
||||
}
|
||||
|
||||
/* Used by multiheaded child processes to identify when they have
|
||||
|
@ -187,9 +187,9 @@ SetSMFile(char *path)
|
|||
if (sm_file)
|
||||
Efree(sm_file);
|
||||
if (!path)
|
||||
sm_file = duplicate(default_save_prefix());
|
||||
sm_file = Estrdup(default_save_prefix());
|
||||
else
|
||||
sm_file = duplicate(path);
|
||||
sm_file = Estrdup(path);
|
||||
stale_sm_file = 0;
|
||||
}
|
||||
|
||||
|
@ -303,24 +303,24 @@ LoadWindowStates(void)
|
|||
}
|
||||
else if (!strcmp(s1, "[SESSION_ID]"))
|
||||
{
|
||||
matches[num_match - 1].session_id = duplicate(atword(s, 2));
|
||||
matches[num_match - 1].session_id = Estrdup(atword(s, 2));
|
||||
}
|
||||
else if (!strcmp(s1, "[NAME]"))
|
||||
{
|
||||
matches[num_match - 1].name = duplicate(atword(s, 2));
|
||||
matches[num_match - 1].name = Estrdup(atword(s, 2));
|
||||
}
|
||||
else if (!strcmp(s1, "[CLASS]"))
|
||||
{
|
||||
matches[num_match - 1].class = duplicate(atword(s, 2));
|
||||
matches[num_match - 1].class = Estrdup(atword(s, 2));
|
||||
}
|
||||
else if (!strcmp(s1, "[ROLE]"))
|
||||
{
|
||||
matches[num_match - 1].role = duplicate(atword(s, 2));
|
||||
matches[num_match - 1].role = Estrdup(atword(s, 2));
|
||||
/* Needed for matching X11R5 clients */
|
||||
}
|
||||
else if (!strcmp(s1, "[COMMAND]"))
|
||||
{
|
||||
matches[num_match - 1].command = duplicate(atword(s, 2));
|
||||
matches[num_match - 1].command = Estrdup(atword(s, 2));
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
|
@ -796,7 +796,7 @@ SessionInit(void)
|
|||
char *client_id = NULL;
|
||||
|
||||
if (sm_client_id)
|
||||
client_id = duplicate(sm_client_id);
|
||||
client_id = Estrdup(sm_client_id);
|
||||
sm_conn =
|
||||
SmcOpenConnection(NULL, &context, SmProtoMajor, SmProtoMinor,
|
||||
SmcSaveYourselfProcMask | SmcDieProcMask |
|
||||
|
|
|
@ -2566,7 +2566,7 @@ CB_DesktopMiniDisplayRedraw(int val, void *data)
|
|||
Efree(tbg->bg.file);
|
||||
tbg->bg.file = NULL;
|
||||
if (tmp_bg_image)
|
||||
tbg->bg.file = duplicate(tmp_bg->bg.file);
|
||||
tbg->bg.file = Estrdup(tmp_bg->bg.file);
|
||||
else
|
||||
{
|
||||
if (tbg->bg.im)
|
||||
|
@ -2611,7 +2611,7 @@ BG_DoDialog(void)
|
|||
if (tmp_bg->bg.file)
|
||||
stmp = fullfileof(tmp_bg->bg.file);
|
||||
else
|
||||
stmp = duplicate(_("-NONE-"));
|
||||
stmp = Estrdup(_("-NONE-"));
|
||||
Esnprintf(s, sizeof(s),
|
||||
_("Background definition information:\nName: %s\nFile: %s\n"),
|
||||
tmp_bg->name, stmp);
|
||||
|
@ -3647,7 +3647,7 @@ SettingsBackground(Background * bg)
|
|||
if (tmp_bg->bg.file)
|
||||
stmp = fullfileof(tmp_bg->bg.file);
|
||||
else
|
||||
stmp = duplicate(_("-NONE-"));
|
||||
stmp = Estrdup(_("-NONE-"));
|
||||
Esnprintf(s, sizeof(s),
|
||||
_("Background definition information:\nName: %s\nFile: %s\n"),
|
||||
tmp_bg->name, stmp);
|
||||
|
@ -3794,7 +3794,7 @@ SettingsIconbox(char *name)
|
|||
tmp_ib_animate = ib->animate;
|
||||
if (tmp_ib_name)
|
||||
Efree(tmp_ib_name);
|
||||
tmp_ib_name = duplicate(name);
|
||||
tmp_ib_name = Estrdup(name);
|
||||
|
||||
d = DialogCreate("CONFIGURE_ICONBOX");
|
||||
DialogSetTitle(d, _("Iconbox Settings"));
|
||||
|
|
|
@ -177,7 +177,7 @@ SetupX()
|
|||
*dispstr = '\0';
|
||||
}
|
||||
Esnprintf(subdisplay + strlen(subdisplay), 10, ".%d", i);
|
||||
dstr = duplicate(subdisplay);
|
||||
dstr = Estrdup(subdisplay);
|
||||
disp = XOpenDisplay(dstr);
|
||||
root.scr = i;
|
||||
/* Terminate the loop as I am the child process... */
|
||||
|
|
|
@ -89,7 +89,7 @@ SlideoutCreate(char *name, char dir)
|
|||
if (!s)
|
||||
EDBUG_RETURN(NULL);
|
||||
|
||||
s->name = duplicate(name);
|
||||
s->name = Estrdup(name);
|
||||
s->direction = dir;
|
||||
s->num_buttons = 0;
|
||||
s->button = NULL;
|
||||
|
|
28
src/snaps.c
28
src/snaps.c
|
@ -84,12 +84,12 @@ GetSnapshot(EWin * ewin)
|
|||
if ((ewin->client.name) && (ewin->client.class))
|
||||
{
|
||||
sn->win_title = NULL;
|
||||
sn->win_name = duplicate(ewin->client.name);
|
||||
sn->win_class = duplicate(ewin->client.class);
|
||||
sn->win_name = Estrdup(ewin->client.name);
|
||||
sn->win_class = Estrdup(ewin->client.class);
|
||||
}
|
||||
else
|
||||
{
|
||||
sn->win_title = duplicate(ewin->client.title);
|
||||
sn->win_title = Estrdup(ewin->client.title);
|
||||
sn->win_name = NULL;
|
||||
sn->win_class = NULL;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ NewSnapshot(char *name)
|
|||
Snapshot *sn;
|
||||
|
||||
sn = Emalloc(sizeof(Snapshot));
|
||||
sn->name = duplicate(name);
|
||||
sn->name = Estrdup(name);
|
||||
sn->win_title = NULL;
|
||||
sn->win_name = NULL;
|
||||
sn->win_class = NULL;
|
||||
|
@ -588,9 +588,9 @@ SnapshotEwinBorder(EWin * ewin)
|
|||
Efree(sn->border_name);
|
||||
sn->border_name = NULL;
|
||||
if (ewin->previous_border)
|
||||
sn->border_name = duplicate(ewin->previous_border->name);
|
||||
sn->border_name = Estrdup(ewin->previous_border->name);
|
||||
else if (ewin->border)
|
||||
sn->border_name = duplicate(ewin->border->name);
|
||||
sn->border_name = Estrdup(ewin->border->name);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -702,7 +702,7 @@ SnapshotEwinIcon(EWin * ewin)
|
|||
if (sn->iclass_name)
|
||||
Efree(sn->iclass_name);
|
||||
sn->iclass_name = NULL;
|
||||
/* sn->iclass_name = duplicate(ewin->border->name); */
|
||||
/* sn->iclass_name = Estrdup(ewin->border->name); */
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -737,7 +737,7 @@ SnapshotEwinCmd(EWin * ewin)
|
|||
sn->use_cmd = 1;
|
||||
if (sn->cmd)
|
||||
Efree(sn->cmd);
|
||||
sn->cmd = duplicate(ewin->client.command);
|
||||
sn->cmd = Estrdup(ewin->client.command);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -999,15 +999,15 @@ LoadSnapInfo(void)
|
|||
else if (sn)
|
||||
{
|
||||
if (!strcmp(s, "TITLE:"))
|
||||
sn->win_title = duplicate(atword(buf, 2));
|
||||
sn->win_title = Estrdup(atword(buf, 2));
|
||||
else if (!strcmp(s, "NAME:"))
|
||||
sn->win_name = duplicate(atword(buf, 2));
|
||||
sn->win_name = Estrdup(atword(buf, 2));
|
||||
else if (!strcmp(s, "CLASS:"))
|
||||
sn->win_class = duplicate(atword(buf, 2));
|
||||
sn->win_class = Estrdup(atword(buf, 2));
|
||||
else if (!strcmp(s, "CMD:"))
|
||||
{
|
||||
sn->use_cmd = 1;
|
||||
sn->cmd = duplicate(atword(buf, 2));
|
||||
sn->cmd = Estrdup(atword(buf, 2));
|
||||
}
|
||||
else if (!strcmp(s, "DESKTOP:"))
|
||||
{
|
||||
|
@ -1118,9 +1118,9 @@ LoadSnapInfo(void)
|
|||
sn->shade = atoi(s);
|
||||
}
|
||||
else if (!strcmp(s, "BORDER:"))
|
||||
sn->border_name = duplicate(atword(buf, 2));
|
||||
sn->border_name = Estrdup(atword(buf, 2));
|
||||
else if (!strcmp(s, "ICON:"))
|
||||
sn->iclass_name = duplicate(atword(buf, 2));
|
||||
sn->iclass_name = Estrdup(atword(buf, 2));
|
||||
else if (!strcmp(s, "GROUP:"))
|
||||
{
|
||||
word(buf, 2, s);
|
||||
|
|
|
@ -103,7 +103,7 @@ LoadWav(char *file)
|
|||
#else
|
||||
afSetVirtualByteOrder(in_file, AF_DEFAULT_TRACK, AF_BYTEORDER_LITTLEENDIAN);
|
||||
#endif
|
||||
s->file = duplicate(find);
|
||||
s->file = Estrdup(find);
|
||||
s->rate = 44100;
|
||||
s->format = ESD_STREAM | ESD_PLAY;
|
||||
s->samples = 0;
|
||||
|
@ -207,8 +207,8 @@ SclassCreate(const char *name, const char *file)
|
|||
sclass = Emalloc(sizeof(SoundClass));
|
||||
if (!sclass)
|
||||
EDBUG_RETURN(NULL);
|
||||
sclass->name = duplicate(name);
|
||||
sclass->file = duplicate(file);
|
||||
sclass->name = Estrdup(name);
|
||||
sclass->file = Estrdup(file);
|
||||
sclass->sample = NULL;
|
||||
AddItem(sclass, sclass->name, 0, LIST_TYPE_SCLASS);
|
||||
EDBUG_RETURN(sclass);
|
||||
|
|
|
@ -215,7 +215,7 @@ TclassApply(ImageClass * iclass, Window win, int w, int h, int active,
|
|||
if (dq->tclass)
|
||||
dq->tclass->ref_count++;
|
||||
if (text)
|
||||
dq->text = duplicate(text);
|
||||
dq->text = Estrdup(text);
|
||||
else
|
||||
dq->text = NULL;
|
||||
dq->w = w;
|
||||
|
|
|
@ -160,7 +160,7 @@ TextStateLoadFont(TextState * ts)
|
|||
char s[4096], w[4046], *dup, *ss;
|
||||
|
||||
dup = NULL;
|
||||
dup = duplicate(ts->fontname);
|
||||
dup = Estrdup(ts->fontname);
|
||||
ss = strchr(dup, '/');
|
||||
if (ss)
|
||||
{
|
||||
|
|
22
src/theme.c
22
src/theme.c
|
@ -169,11 +169,11 @@ append_merge_dir(char *dir, char ***list, int *count)
|
|||
if (readlink(ss, s, sizeof(s)) > 0)
|
||||
{
|
||||
if (s[0] == '/')
|
||||
def = duplicate(s);
|
||||
def = Estrdup(s);
|
||||
else
|
||||
{
|
||||
Esnprintf(s, sizeof(s), "%s/%s", dir, s);
|
||||
def = duplicate(s);
|
||||
def = Estrdup(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ append_merge_dir(char *dir, char ***list, int *count)
|
|||
(*list) =
|
||||
Erealloc(*list, (*count) * sizeof(char *));
|
||||
|
||||
(*list)[(*count) - 1] = duplicate(s);
|
||||
(*list)[(*count) - 1] = Estrdup(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -245,11 +245,11 @@ ThemeGetDefault(void)
|
|||
{
|
||||
s[count] = 0;
|
||||
if (isabspath(s))
|
||||
def = duplicate(s);
|
||||
def = Estrdup(s);
|
||||
else
|
||||
{
|
||||
Esnprintf(ss, sizeof(ss), "%s/themes/%s", EDirUser(), s);
|
||||
def = duplicate(ss);
|
||||
def = Estrdup(ss);
|
||||
}
|
||||
return def;
|
||||
}
|
||||
|
@ -260,11 +260,11 @@ ThemeGetDefault(void)
|
|||
{
|
||||
s[count] = 0;
|
||||
if (isabspath(s))
|
||||
def = duplicate(s);
|
||||
def = Estrdup(s);
|
||||
else
|
||||
{
|
||||
Esnprintf(ss, sizeof(ss), "%s/themes/%s", EDirRoot(), s);
|
||||
def = duplicate(ss);
|
||||
def = Estrdup(ss);
|
||||
}
|
||||
return def;
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ ThemeExtract(const char *theme)
|
|||
|
||||
exit:
|
||||
if (oktheme && SanitiseThemeDir(oktheme))
|
||||
EDBUG_RETURN(duplicate(oktheme));
|
||||
EDBUG_RETURN(Estrdup(oktheme));
|
||||
|
||||
/* failed */
|
||||
ThemeCleanup();
|
||||
|
@ -376,13 +376,13 @@ FindTheme(const char *theme)
|
|||
|
||||
if (conf.theme.name)
|
||||
Efree(conf.theme.name);
|
||||
conf.theme.name = duplicate(theme);
|
||||
conf.theme.name = Estrdup(theme);
|
||||
badreason = _("Unknown\n");
|
||||
|
||||
if (!theme[0])
|
||||
{
|
||||
Esnprintf(s, sizeof(s), "%s/themes/DEFAULT", EDirRoot());
|
||||
EDBUG_RETURN(duplicate(s));
|
||||
EDBUG_RETURN(Estrdup(s));
|
||||
}
|
||||
|
||||
if (isabspath(theme))
|
||||
|
@ -404,7 +404,7 @@ FindTheme(const char *theme)
|
|||
if (!ret)
|
||||
{
|
||||
ret = ThemeGetDefault();
|
||||
badtheme = duplicate(theme);
|
||||
badtheme = Estrdup(theme);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ DoIn(char *name, double in_time, void (*func) (int val, void *data),
|
|||
qe = Emalloc(sizeof(Qentry));
|
||||
if (!qe)
|
||||
EDBUG_RETURN_;
|
||||
qe->name = duplicate(name);
|
||||
qe->name = Estrdup(name);
|
||||
qe->func = func;
|
||||
qe->next = NULL;
|
||||
qe->in_time = in_time;
|
||||
|
|
|
@ -38,7 +38,7 @@ CreateToolTip(char *name, ImageClass * ic0, ImageClass * ic1,
|
|||
EDBUG_RETURN((ToolTip *) NULL);
|
||||
|
||||
tt = Emalloc(sizeof(ToolTip));
|
||||
tt->name = duplicate(name);
|
||||
tt->name = Estrdup(name);
|
||||
tt->iclass = ic0;
|
||||
if (ic0)
|
||||
ic0->ref_count++;
|
||||
|
|
|
@ -31,7 +31,7 @@ CreateWindowMatch(char *name)
|
|||
b = Emalloc(sizeof(WindowMatch));
|
||||
if (!b)
|
||||
EDBUG_RETURN(NULL);
|
||||
b->name = duplicate(name);
|
||||
b->name = Estrdup(name);
|
||||
b->win_title = NULL;
|
||||
b->win_name = NULL;
|
||||
b->win_class = NULL;
|
||||
|
|
Loading…
Reference in New Issue