Copy/paste Bug??

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Binder
Tinkerer
Posts: 44
Joined: Sat Jan 06, 2007 3:07 am

Copy/paste Bug??

Post by Binder »

I have noticed this with the official and recent Windows SheepShaver builds. When coping/pasting text from most text programs, SheepShaver is adding an extra invisible character to the end of the pasted text. A quick example would be to open a text file with SimpleText. Copy a section of text and paste somewhere in the same file. Now use the right arrow key on your keyboard and tap through the pasted text. When you reach the end the cursor will appear to not move for one tap.

This those not seem to be much of a problem when using the text files in Mac OS, but when converting and using them in windows, they become spaces. :(
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Copy/paste Bug??

Post by Ronald P. Regensburg »

Binder wrote:A quick example would be to open a text file with SimpleText.
A text file that was created in SimpleText (or another application in MacOS) or a text file that was created in a Windows application and transferred into SheepShaver?
Binder
Tinkerer
Posts: 44
Joined: Sat Jan 06, 2007 3:07 am

Post by Binder »

Any text file, or just create a new one in SimpleText. Sheepshaver is adding an extra invisible character to any pasted text.
Binder
Tinkerer
Posts: 44
Joined: Sat Jan 06, 2007 3:07 am

Post by Binder »

Hi,
Was anyone able to reproduce this problem?

Thanks.
kelvin31415
Tinkerer
Posts: 83
Joined: Sat Apr 12, 2008 8:22 pm

Post by kelvin31415 »

I tried it with SimpleText running in Mac OS 8.6 under the latest Mac OS X Intel SheepShaver build. I did not observe the behavior you describe. It behaved exactly as I would expect it to.
100Day
Student Driver
Posts: 11
Joined: Sat Jul 19, 2008 3:45 am
Location: Florida/Minnesota USA

Post by 100Day »

Binder

Tried it and my results are as Kelvin's, but in OS 9.0 in Ronald's latest build on a PPC machine, not Intel.

Also copied the test text to a proper text editor and examined it for extra/hidden/etc. characters and found none. The right-arrow stepping in SimpleText also behaved as I expect, no extra characters.

I am using the hardware cursor version, if that might be significant (I don't think so.)
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Post by Ronald P. Regensburg »

'Binder' apparently noticed the problem in SheepShaver for Windows, so maybe someone using SheepShaver in Windows can try this and report his findings here.
User avatar
ClockWise
Site Admin
Posts: 4397
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang

Post by ClockWise »

I'll try it out when I get home from work in a few hours.
User avatar
ClockWise
Site Admin
Posts: 4397
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang

Post by ClockWise »

That doesn't happen for me, using the updated build from here, or the 2006 build from Gwenole.
boyanml
Inquisitive Elf
Posts: 35
Joined: Tue Oct 19, 2004 11:15 am
Location: Sofia, Bulgaria

Post by boyanml »

As for me, yes, there is an additional character at the end of the line, but only with the new build. The character code (as I see in UltraEdit in hex mode) is 00.
In addition, I noticed transfering text via clipboard from SS (new build) to Windows is more problematic and uncomplete, compared to Gwenole (2006/05/15) build.

Windows XP SP3
SheepShaver in fullscreen mode (both builds)
SDL 1.2.10.0
MacOS 9.0.4
Binder
Tinkerer
Posts: 44
Joined: Sat Jan 06, 2007 3:07 am

Post by Binder »

Thank you everyone for trying it out. So it seems to only effect windows builds.

ClockWise,
Are you testing the windows build? with OS 9.0.4?

boyanml,
Are you using the same setup when you tested the different builds? (just replacing the .exe and .sdl files?)

I have not been able to get any windows build working correctly.I only have OS 9.0.4 to test with.
Also if I copy a section of a file name and paste to another file name, same problem. Looks like the OS's clipboard is being affected.
User avatar
ClockWise
Site Admin
Posts: 4397
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang

Post by ClockWise »

I'm using the Windows version and Mac OS 9.0.4. I'm not seeing the bug. Odd.
boyanml
Inquisitive Elf
Posts: 35
Joined: Tue Oct 19, 2004 11:15 am
Location: Sofia, Bulgaria

Post by boyanml »

Binder wrote:Are you using the same setup when you tested the different builds? (just replacing the .exe and .sdl files?)
Same prefs, same SDL, different exe.
Binder wrote:Also if I copy a section of a file name and paste to another file name, same problem.
Same thing here with both builds.
Thomas J. Rostafinski
Student Driver
Posts: 16
Joined: Tue Apr 15, 2008 10:42 pm
Location: Chicago

Copy-Paste problem in SSWin

Post by Thomas J. Rostafinski »

I ran into the copy-paste bug when authenticating my old copy of DropStuff. I copied the registration key from a WordPerfect file where I keep such things and pasted it into the registration dialog box, only to be told that what I had entered was invalid. This was before this E-Maculation thread appeared. So then I tried entering left-delete (backspace) once after pasting in the number. The number did not change in appearance, but apparently this effectively removed some invisible character from the end of the number, because this time the registration was accepted. When I paste items into WordPerfect, no additional characters show in the main window or in the Reveal Codes window. Strange.
MacUser
Tinkerer
Posts: 64
Joined: Thu Apr 20, 2006 7:24 am

Post by MacUser »

I am not 100% sure but can it be an issue of a combined CR+LF character (both invisble) that is present at the end of each text line in Windows while OS9 only use a single CR character and therefore refuses to use the extra ( LF ) character ?

see: http://en.wikipedia.org/wiki/Newline

Wim
umax
Inquisitive Elf
Posts: 37
Joined: Sun Sep 28, 2008 8:02 pm
Location: berlin, germany

Post by umax »

i can confirm the bug on sheepshaver for windows.
strangely, it only occurs when copying text from/into DIFFERENT applications (or filenames from the desktop).
it can easily be reproduced when copying a filename into a hexeditor. the value 00 HEX is always added at the end.

with simpletext it's not that obvious: copy a filename or foldername into simpletext and delete the last char: you will see no change, because the 00 HEX is not displayed in simpletext (but it nevertheless gets deleted).
it also works the other way round: write a name, copy the name, create a new folder and paste the name into it.
when you delete the last char, nothing will happen - again, because it's invisible.

if you paste a name from the clipboard, then select the name and copy/paste it back to simpletxt, you will have two 00 HEX chars. you can do this many times and every time a 00 HEX char will be added.

the strangest thing is: it does not happen if you copy and paste text into the same application. copying and pasting from and into simpletext is OK, but pasting from/into a different texteditor adds 00 HEX. and the other way round.

tested on mac OS 7.61 and OS 9.04.
this does NOT happen on a "real" mac, must be a sheepshaver-bug.

edit:
here is an easy check - copy the name of a file, launch sherlock (or apple+f), paste the name into the search-window and perform a search.
the file will never be found, because of the 00 HEX at the end.
Binder
Tinkerer
Posts: 44
Joined: Sat Jan 06, 2007 3:07 am

Post by Binder »

Hi again Guys,

Is there a certain place in the source code I can look to find the cause of this bug??

To recap, the problem is only happening on the windows builds, basically when copying text and then pasting, SS is adding an invisible character that some programs have a hard time dealing with. For example, I would like to use SS for a proprietary programming language were the text gets compiled. Those extra characters are a nightmare to hunt down and delete.

Thanks,
Bill.
kelvin31415
Tinkerer
Posts: 83
Joined: Sat Apr 12, 2008 8:22 pm

Post by kelvin31415 »

Binder wrote:Hi again Guys,

Is there a certain place in the source code I can look to find the cause of this bug??

To recap, the problem is only happening on the windows builds, basically when copying text and then pasting, SS is adding an invisible character that some programs have a hard time dealing with. For example, I would like to use SS for a proprietary programming language were the text gets compiled. Those extra characters are a nightmare to hunt down and delete.

Thanks,
Bill.
A quick examination of BasiliskII/src/Windows/clip_windows.cpp reveals a possible cause. When adding a text string to the Windows ClipBoard, the function do_putscrap() adds a null terminator to the end of the string, as required by SetClipboardData(). However, when retrieving a text string from the ClipBoard, do_getscrap() does not appear to account for the presence of the null terminator, but rather, includes it as part of the text.

That's easily fixed, but I lack the time and access to a Windows machine that I would need to build and test it.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Hi Kelvin,

If you could provide the fix for the source, I will try to build a new windows executable.

Best,
Cat_7
umax
Inquisitive Elf
Posts: 37
Joined: Sun Sep 28, 2008 8:02 pm
Location: berlin, germany

Post by umax »

great, if you could fix this bug it would be fantastic!
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Hi,

This build includes the fix Kelvin sent me:

http://www.open.ou.nl/hsp/downloads/She ... 3_2009.zip

I tested as mentioned above: with an older build I copied a file name and tried to find it with Sherlock: it failed
The newer build does find the file, so I guess that problem is solved!

However, when I copy some text from windows to mac os, I get a lot of rubbish pasted on the mac side.

Best,
Cat_7
kelvin31415
Tinkerer
Posts: 83
Joined: Sat Apr 12, 2008 8:22 pm

Post by kelvin31415 »

Looks like deeper analysis will be needed. I don't know when I'll be able to get to this, and the lack of a Windows build/test environment just makes it that much harder. If anybody else wants to give it a go, please do! Otherwise, I'll have another look sometime after tax season.
Binder
Tinkerer
Posts: 44
Joined: Sat Jan 06, 2007 3:07 am

Post by Binder »

kelvin31415 and Cat_7,

You are my heroes!
The new build is working perfectly for me, I'm not even seeing a problem copying between windows and mac os.

Bill.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

This shows the error I get when copying a text from Simpletext in Mac OS to wordpad in Windows, edit it and copy it back to Simpletext in Mac OS.

Image

I tried to paste the text here, but then the additional characters don't show up.

(this is on Windows Vista SP1, using my latest SheepShaver for Windows build)

Cat_7
kelvin31415
Tinkerer
Posts: 83
Joined: Sat Apr 12, 2008 8:22 pm

Post by kelvin31415 »

Very useful information, and points to what looks like another bug in the same routine as before. Also easily fixed (PM'd to you for build and test; many thanks for your help with this).
Post Reply