Let $X$ be an algebraic surface (so a 2-dimensional, proper $k$-scheme), $D \subset$ an effective cartier divisor with corresponding invertible sheaf $\mathcal{L} = \mathcal{O}_X(D)$ and $C \subset$ a irreduciblecurve (1-dimensional, proper $k$-scheme) without embedded components and it don't common irreducible components with $D$.
Obviously, by restricting $\mathcal{L}$ to $\mathcal{L} \vert _C = \mathcal{O}_C(D)$ we get firstly following exact sequence
$$ \mathcal{O}_C(D) \to \mathcal{O}_C \to \mathcal{O}_{C \cap D} \to 0$$
My goal is to show that $\mathcal{O}_C(D) \to \mathcal{O}_C$ is injective. Since this is determined on stalks (so it's a local problem) I have to show that for each $c \in C$ the induced morphism of local rings $\mathcal{O}_C(D)_{c,C} \to (\mathcal{O}_C)_{c,C}$ is injective.
Again, since the problem is local, I can consider $X= Spec(R)$ and $C = Spec(R/I)$ for an ideal $I$. Futhermore $\mathcal{L}$ is localy given by a principal ideal $fR$ for a regular $f \in R$. Therefore $\mathcal{L} \vert D$ is given by $f(R/I)$.
Since $C$ is a curve, each point of $C$ is a closed point $a$ (corresponds to a maximal ideal of $R$) or a generic point (corresponds to a minimal ideal).
Let consider the stalk of theclosed point $a$ with maximal ideal $m_a$.
How to prove that if $f \neq 0$ in $R/I$ then it's regular in $R/I$, therefore it induces an injection
$$\mathcal{O}_C(D)_{a,C} \to (\mathcal{O}_C)_{a,C}$$
on stalks?