Always duplicate mode name when duplicating a mode.

If the originating mode didn't have a name, we would end up with the name of
the original mode being setup correctly, but with the name of the copy still
being NULL.
This commit is contained in:
Matthias Hopf 2007-11-02 19:27:32 +01:00
parent dfb1cce28a
commit 4d0f35c81d

View File

@ -196,9 +196,8 @@ xf86DuplicateMode(DisplayModePtr pMode)
pNew->prev = NULL; pNew->prev = NULL;
if (pNew->name == NULL) { if (pNew->name == NULL) {
xf86SetModeDefaultName(pMode); xf86SetModeDefaultName(pMode);
} else {
pNew->name = xnfstrdup(pMode->name);
} }
pNew->name = xnfstrdup(pMode->name);
return pNew; return pNew;
} }