--- rewrite.php (22042)
+++ rewrite.php (working copy)
@@ -1940,9 +1940,10 @@
 	 */
 	function set_permalink_structure($permalink_structure) {
 		if ( $permalink_structure != $this->permalink_structure ) {
+			$old_permalink_structure = $this->permalink_structure;
 			update_option('permalink_structure', $permalink_structure);
 			$this->init();
-			do_action('permalink_structure_changed', $this->permalink_structure, $permalink_structure);
+			do_action('permalink_structure_changed', $old_permalink_structure, $permalink_structure);
 		}
 	}
 
