Commit fd41f46a authored by Adam Jackson's avatar Adam Jackson 🎧

Allow xf86DuplicateMode() to work correctly on read-only modes.

Before this it was meaningless to try to mark DisplayModeRec tables
const, since the mode name would be emitted as a pointer to an
anonymous string constant, and therefore would have to be fixed up by and so couldn't live in .rodata.  With this change the standard
mode lists can live in .rodata, and modes duplicated from them will
have their names filled in on the fly.
parent 8ac19d16
......@@ -214,10 +214,8 @@ xf86DuplicateMode(DisplayModePtr pMode)
*pNew = *pMode;
pNew->next = NULL;
pNew->prev = NULL;
if (pNew->name == NULL) {
pNew->name = xnfstrdup(pMode->name);
if (pNew->name == NULL)
return pNew;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment