4. If $a$, $b$, and $c$ are the lengths of the sides of a triangle, and satisfy $\frac{1}{a}+\frac{1}{b}-\frac{1}{c}=\frac{1}{a+b-c}$, then it must be true that ( ).
(A) $a=b=c$
(B) $a=b$
(C) $a=c$ or $b=c$
(D) $a^{2}+b^{2}=c^{2}$
4. C.

From the fractional simplification, we get
$$
(a+b)(a-c)(b-c)=0 \text {. }
$$

Therefore, $a=c$ or $b=c$.