TITLE: Hartshorne's proof of the exact sequence $\mathbb{Z} \to \operatorname{Cl} X \to \operatorname{Cl} U \to 0$
QUESTION [7 upvotes]: Hartshorne, Algebraic Geometry, Proposition II.6.5 reads (in part):

Let $X$ satisfy (*), let $Z$ be a proper closed subset of $X$, and let $U = X \setminus Z$.  Then:
[...]
(c) if $Z$ is an irreducible subset of codimension 1, then there is an exact sequence 
$$\mathbb{Z} \to \operatorname{Cl} X \to \operatorname{Cl} U \to 0,$$
where the first map is defined by $1 \mapsto 1 \cdot Z$.

The condition (*) here is just saying that $X$ has a workable theory of Weil divisors, viz.

(*) $X$ is a noetherian integral separated scheme which is regular in codimension one.

Here's is Hartshorne's proof:

The kernel of $\operatorname{Cl} X \to \operatorname{Cl} U$ consists of divisors whose support is contained in $Z$.  If $Z$ is irreducible, the kernel is just the subgroup of $\operatorname{Cl} X$ generated by $1 \cdot Z$.

As written, this doesn't seem to make sense.  For instance, consider the case where $X = \mathbb{P}^2$, $Z = V(x_0) \subset \mathbb{P}^2$, and hence $U = X \setminus Z \cong \mathbb{A}^1$.  Then $\operatorname{Cl} U = 0$, so this says that every divisor in $\mathbb{P}^2$ is supported on $Z$.  But of course this is false, because there are higher degree curves.
Of course, these higher-degree curves are linearly equivalent to divisors supported on $Z$, or the theorem would be false.  But I don't see how this has been proven.

REPLY [4 votes]: Yes, it's not quite correct as written, but the argument is straightforward—or, at least, as straightforward as other things omitted in the book.
Given a Weil divisor $D$ on $X$, if $D$ maps to zero in $\operatorname{Cl} U$, then there is a rational function $f$ on $U$ with $(f) = D\cap U$ on $U$.  Then, on $X$, $D-(f)$ is supported on $Z$, so $D$ is linearly equivalent to a divisor supported on $Z$.