gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r2505 - Extractor/src/plugins/wordleaker


From: grothoff
Subject: [GNUnet-SVN] r2505 - Extractor/src/plugins/wordleaker
Date: Tue, 14 Mar 2006 20:54:07 -0800 (PST)

Author: grothoff
Date: 2006-03-14 20:54:05 -0800 (Tue, 14 Mar 2006)
New Revision: 2505

Modified:
   Extractor/src/plugins/wordleaker/wordextractor.cc
   Extractor/src/plugins/wordleaker/wordleaker.cpp
Log:
better

Modified: Extractor/src/plugins/wordleaker/wordextractor.cc
===================================================================
--- Extractor/src/plugins/wordleaker/wordextractor.cc   2006-03-14 20:43:28 UTC 
(rev 2504)
+++ Extractor/src/plugins/wordleaker/wordextractor.cc   2006-03-15 04:54:05 UTC 
(rev 2505)
@@ -90,15 +90,6 @@
   static const char * idToProduct( unsigned int id ) {
     // TODO: find the rest of ids (and check existing ones!)
     switch ( id ) {
-    case 0xa:
-    case 0x46:
-    case 0x490d:
-    case 0x101:
-    case 0x193:
-    case 0x201:
-    case 0xffff:
-    case 0x4000:
-      return "Powerpoint?";      
     case 0x6954:
     case 0x656d:
       return "Word 97 (Windows NT)?";
@@ -110,7 +101,7 @@
     case 0x626A:
       return "Word 98 (Mac)";
     default:
-      return "Unknown";
+      return NULL;
     }      
   }
 
@@ -343,22 +334,28 @@
                        lang,
                        prev);
     }
-    char * date = dateToString(lProductCreated);
-    snprintf(product, 128, _("%s (Build %s)"),
-            idToProduct(wMagicCreated),
-            date);
-    free(date);
-    prev = addKeyword(EXTRACTOR_CREATED_BY_SOFTWARE,
-                     product,
-                     prev);
-    date = dateToString(lProductRevised);
-    snprintf(product, 128, _("%s (Build %s)"),
-            idToProduct(wMagicRevised),
-            date);
-    free(date);
-    prev = addKeyword(EXTRACTOR_MODIFIED_BY_SOFTWARE,
-                     product,
-                     prev);
+    const char * prod = idToProduct(wMagicCreated);
+    if (prod != NULL) {
+      char * date = dateToString(lProductCreated);
+      snprintf(product, 128, _("%s (Build %s)"),
+              prod,
+              date);
+      free(date);
+      prev = addKeyword(EXTRACTOR_CREATED_BY_SOFTWARE,
+                       product,
+                       prev);
+    }
+    prod = idToProduct(wMagicRevised);
+    if (prod != NULL) {
+      date = dateToString(lProductRevised);
+      snprintf(product, 128, _("%s (Build %s)"),
+              prod,
+              date);
+      free(date);
+      prev = addKeyword(EXTRACTOR_MODIFIED_BY_SOFTWARE,
+                       product,
+                       prev);
+    }
     
     POLE::Storage* storage = new POLE::Storage( filename );
     storage->open();

Modified: Extractor/src/plugins/wordleaker/wordleaker.cpp
===================================================================
--- Extractor/src/plugins/wordleaker/wordleaker.cpp     2006-03-14 20:43:28 UTC 
(rev 2504)
+++ Extractor/src/plugins/wordleaker/wordleaker.cpp     2006-03-15 04:54:05 UTC 
(rev 2505)
@@ -83,7 +83,7 @@
         cout << s;
         break;
       default:
-          cout << "Unknown format " << type << endl;
+       cout << "Unknown format " << type << endl;
   }
 }
 





reply via email to

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