Adiabatic evolution of mass-losing stars