Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019Lve9SVJCxK6nR8MYkP2zu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The help text (0.10) says
/-Y"Causes prompting to confirm you want to overwrite an existing destination file", which is also howCOPYCMD=/-Yworks in MS-DOS and in FreeCOM's COPY. Inmove.cboth map toSKIP:move.c:601-613-COPYCMD=/-Y(and/N) ->opt_prompt = SKIPmove.c:635-636- option/-Y->opt_prompt = SKIPFreeDOS sets
COPYCMD=/-YinFDAUTO.BAT, so on a default installation MOVE never asks: it prints " [File already exists]" and skips, while COPY asks. Found while testing the Polish translation (the overwrite prompt never appeared).While there:
strncpy(environ, getenv("COPYCMD"), ...)has no NULL check, so with COPYCMD unset it reads from address 0, and the copy is not terminated if the value is 255+ chars.This PR:
/-Y(option and COPYCMD) ->ASK(prompt), as documented;COPYCMD=/NstaysSKIP,/YstaysOVERWRITE;getenvresult checked, copy always terminated.Tested on FreeDOS T2610 (QEMU), built with Open Watcom 2.0 (
build.batflags), Polish NLS:COPYCMD=/-Yfrom FDAUTO)Nkeeps the target/YCOPYCMD=/YCOPYCMD=/NCOPYCMDunsetNoneskipsCOPYCMD=/Y+ option/-YAllmoves