Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 46438 Details for
Bug 75052
backup file patch request for qemacs
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patches for qemacs-0.3.1
qemacs.patch (text/plain), 3.79 KB, created by
Oliver Albers
on 2004-12-20 07:27:25 UTC
(
hide
)
Description:
Proposed patches for qemacs-0.3.1
Filename:
MIME Type:
Creator:
Oliver Albers
Created:
2004-12-20 07:27:25 UTC
Size:
3.79 KB
patch
obsolete
>diff -ruN qemacs-0.3.1/buffer.c qemacs-0.3.1-aon1/buffer.c >--- qemacs-0.3.1/buffer.c2003-04-22 01:01:42.000000000 +0300 >+++ qemacs-0.3.1-aon1/buffer.c2004-11-12 18:53:18.510488192 +0200 >@@ -1437,11 +1437,12 @@ > if (stat(filename, &st) == 0) > mode = st.st_mode & 0777; > >- /* backup old file if present */ >- strcpy(buf1, filename); >- strcat(buf1, "~"); >- rename(filename, buf1); >- >+ /* backup old file if present and make-backup-files is on */ >+ if(mbf == 1) { >+ strcpy(buf1, filename); >+ strcat(buf1, "~"); >+ rename(filename, buf1); >+ } > ret = b->data_type->buffer_save(b, filename); > if (ret < 0) > return ret; >diff -ruN qemacs-0.3.1/configure qemacs-0.3.1-aon1/configure >--- qemacs-0.3.1/configure2003-04-22 01:01:43.000000000 +0300 >+++ qemacs-0.3.1-aon1/configure2004-11-12 18:53:18.511488040 +0200 >@@ -310,9 +310,7 @@ > echo -n "VERSION=" >>config.mak > head $source_path/VERSION >>config.mak > echo "" >>config.mak >-echo -n "#define QE_VERSION \"" >> $TMPH >-head $source_path/VERSION >> $TMPH >-echo "\"" >> $TMPH >+echo "#define QE_VERSION \"`head $source_path/VERSION`\"" >> $TMPH > if test "$network" = "yes" ; then > echo "#define CONFIG_NETWORK 1" >> $TMPH > echo "CONFIG_NETWORK=yes" >> config.mak >diff -ruN qemacs-0.3.1/qe.c qemacs-0.3.1-aon1/qe.c >--- qemacs-0.3.1/qe.c2003-04-22 01:01:42.000000000 +0300 >+++ qemacs-0.3.1-aon1/qe.c2004-11-12 18:53:52.524317304 +0200 >@@ -61,7 +61,7 @@ > static QEditScreen global_screen; > static int screen_width = 0; > static int screen_height = 0; >- >+mbf = 1; > /* mode handling */ > > void qe_register_mode(ModeDef *m) >@@ -4319,6 +4319,14 @@ > do_refresh(qs->first_window); > } > >+static void make_backup_files(EditState *s) { >+ if(mbf == 1) { >+ mbf = 0; >+ } else { >+ mbf = 1; >+ } >+} >+ > /* compute default path for find/save buffer */ > static void get_default_path(EditState *s, char *buf, int buf_size) > { >diff -ruN qemacs-0.3.1/qe.h qemacs-0.3.1-aon1/qe.h >--- qemacs-0.3.1/qe.h2003-04-22 01:01:42.000000000 +0300 >+++ qemacs-0.3.1-aon1/qe.h2004-11-12 18:53:18.516487280 +0200 >@@ -1140,3 +1140,5 @@ > int qe_bitmap_format_to_pix_fmt(int format); > > #endif >+ >+int mbf; >diff -ruN qemacs-0.3.1/qeconfig.h qemacs-0.3.1-aon1/qeconfig.h >--- qemacs-0.3.1/qeconfig.h2003-04-22 01:01:42.000000000 +0300 >+++ qemacs-0.3.1-aon1/qeconfig.h2004-11-12 18:53:18.516487280 +0200 >@@ -68,6 +68,8 @@ > CMD1( KEY_CTRLX(KEY_CTRL('u')), KEY_NONE, "upcase-region", > do_changecase_region, 1) > >+ CMD0( KEY_NONE, KEY_NONE, "make-backup-files", make_backup_files) >+ > /* keyboard macros */ > CMD0( KEY_CTRLX('('), KEY_NONE, "start-kbd-macro", do_start_macro) > CMD0( KEY_CTRLX(')'), KEY_NONE, "end-kbd-macro", do_end_macro) >diff -ruN qemacs-0.3.1/shell.c qemacs-0.3.1-aon1/shell.c >--- qemacs-0.3.1/shell.c2003-04-22 01:01:43.000000000 +0300 >+++ qemacs-0.3.1-aon1/shell.c2004-11-12 18:53:18.517487128 +0200 >@@ -78,8 +78,8 @@ > #definePTYCHAR1 "pqrstuvwxyz" > #definePTYCHAR2 "0123456789abcdef" > >-/* allocate one pty/tty pair */ >-static int get_pty(char *tty_str) >+/* allocate one pty/tty pair, the old way */ >+static int old_get_pty(char *tty_str) > { > int fd; > char ptydev[] = "/dev/pty??"; >@@ -103,6 +103,19 @@ > return -1; > } > >+/* ...and the devpts way */ >+static int get_pty(char *tty_str) >+{ >+ int fd; >+ fd = getpt(); >+ if(!fd) return -1; >+ grantpt(fd); >+ unlockpt(fd); >+ char *ttyname = ptsname(); >+ strcpy(tty_str, ttyname); >+ return fd; >+} >+ > static int run_process(const char *path, char **argv, > int *fd_ptr, int *pid_ptr) > { >@@ -111,6 +124,12 @@ > struct winsize ws; > > pty_fd = get_pty(tty_name); >+ >+ /* Try using legacy PTYs if the above doesn't work. */ >+ if(pty_fd < 0) { >+ pty_fd = old_get_pty(tty_name); >+ } >+ > fcntl(pty_fd, F_SETFL, O_NONBLOCK); > if (pty_fd < 0) > return -1;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 75052
: 46438