In a corner portion formed at an intersection of a first block to be machined first and a second block to be machined second, an end point of the first block is extended. Then, after moving from the first block to the extended end point of the first block, a wire electrode of an electrical discharge machine returns to an end point of the original block (an end point of the original first block and a start point of the original second block) therefrom along the same path as before, and machines the second block therefrom.