qemacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemacs-commit] qemacs archive.c util.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs archive.c util.c
Date: Fri, 25 Apr 2014 20:08:17 +0000

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        14/04/25 20:08:17

Modified files:
        .              : archive.c util.c 

Log message:
        fix archive and filtering commands
        
        * fix reduce_filename for 7z archives and man pages
        * add more man page extensions
        * add more nroff head tests

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/archive.c?cvsroot=qemacs&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/qemacs/util.c?cvsroot=qemacs&r1=1.64&r2=1.65

Patches:
Index: archive.c
===================================================================
RCS file: /sources/qemacs/qemacs/archive.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- archive.c   24 Apr 2014 22:14:11 -0000      1.8
+++ archive.c   25 Apr 2014 20:08:17 -0000      1.9
@@ -369,14 +369,19 @@
 static int man_mode_probe(ModeDef *mode, ModeProbeData *p)
 {
     if (match_extension(p->real_filename,
-                        
"1.gz|1SSL.gz|2.gz|3.gz|3SSL.gz|4.gz|5.gz|6.gz|7.gz|8.gz")) {
+                        "1.gz|1m.gz|1ssl.gz|1tcl.gz|2.gz|3.gz|3o.gz|3ssl.gz|"
+                        "4.gz|5.gz|5ssl.gz|6.gz|7.gz|7ssl.gz|8.gz|9.gz")) {
         goto has_man;
     }
    
-    if (match_extension(p->real_filename, "1|1SSL|2|3|3SSL|4|5|6|7|8")
-    &&  !strchr(p->filename, '.')
+    if (match_extension(p->real_filename,
+                        "1|1m|1ssl|1tcl|2|3|3o|3ssl|4|5|5ssl|6|7|7ssl|8|9|"
+                        "n|ntcl")
+//    &&  !strchr(p->filename, '.')
     &&  (p->buf[0] == '.' ||
+         (p->buf[0] == '\n' && p->buf[1] == '.') ||
          !memcmp(p->buf, "'\\\"", 3) ||
+         !memcmp(p->buf, "'''", 3) ||
          !memcmp(p->buf, "\\\"", 2))) {
     has_man:
         if (p->b && p->b->priv_data) {

Index: util.c
===================================================================
RCS file: /sources/qemacs/qemacs/util.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- util.c      24 Mar 2014 09:38:15 -0000      1.64
+++ util.c      25 Apr 2014 20:08:17 -0000      1.65
@@ -323,10 +323,21 @@
 
     dbase = get_basename_nc(dest);
 
-    /* Strip numeric extensions (vcs version numbers) */
+    /* Strip some numeric extensions (vcs version numbers) */
     for (;;) {
+        /* get the last extension */
         ext = get_extension_nc(dbase);
-        if (*ext != '.' || !qe_isdigit(ext[1]))
+        /* no extension */
+        if (*ext != '.')
+            break;
+        /* keep non numeric extension */
+        if (!qe_isdigit(ext[1]))
+            break;
+        /* keep the last extension */
+        if (strchr(dbase, '.') == ext)
+            break;
+        /* only strip multidigit extensions */
+        if (!qe_isdigit(ext[2]))
             break;
         *ext = '\0';
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]