Mercurial > cpython-lru_cache-weakref
diff Modules/stdwinmodule.c @ 50:b94822f54991 legacy-trunk
Change set/getcutbuffer to use the new stdwin interface.
This makes it possible to cut/paste strings wuth embedded null bytes.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 30 Oct 1990 13:39:00 +0000 |
| parents | fc6fcd7df4f7 |
| children | ebcb626cfddf |
line wrap: on
line diff
--- a/Modules/stdwinmodule.c Tue Oct 30 13:34:38 1990 +0000 +++ b/Modules/stdwinmodule.c Tue Oct 30 13:39:00 1990 +0000 @@ -33,6 +33,7 @@ stdwin.getcutbuffer() and stdwin.setcutbuffer(); 'clip' is really a bad word for what these functions do (clipping has a different meaning in the drawing world), while cutbuffer is standard X jargon. + XXX This must change again in the light of changes to stdwin! - For textedit, similar rules hold, but they are less strict. XXX more? */ @@ -1472,7 +1473,7 @@ object *str; if (!getstrarg(args, &str)) return NULL; - wsetclip(getstringvalue(str), getstringsize(str)); + wsetcutbuffer(0, getstringvalue(str), getstringsize(str)); INCREF(None); return None; } @@ -1483,12 +1484,15 @@ object *args; { char *str; + int len; if (!getnoarg(args)) return NULL; - str = wgetclip(); - if (str == NULL) + str = wgetcutbuffer(0, &len); + if (str == NULL) { str = ""; - return newstringobject(str); + len = 0; + } + return newsizedstringobject(str, len); } static struct methodlist stdwin_methods[] = {
