Index: branches/pap/ppSub/src/ppSubDefineOutput.c
===================================================================
--- branches/pap/ppSub/src/ppSubDefineOutput.c	(revision 28179)
+++ branches/pap/ppSub/src/ppSubDefineOutput.c	(revision 28484)
@@ -16,4 +16,5 @@
 
 #include <stdio.h>
+#include <libgen.h>
 #include <pslib.h>
 #include <psmodules.h>
@@ -71,10 +72,19 @@
     pmFPAfile *refFile = psMetadataLookupPtr(NULL, config->files, "PPSUB.REF"); // Reference file
     pmFPAfile *inFile = psMetadataLookupPtr(NULL, config->files, "PPSUB.INPUT"); // Input file
+
+    // We should be using the GNU version of basename() which doesn't modify its argument, but just in case,
+    // we'll copy the string.
+    psString refName = psStringCopy(refFile->filename); // Filename of reference
+    const char *refBase = basename(refName);            // Basename of reference
     psMetadataAddStr(outHDU->header, PS_LIST_TAIL, "PPSUB.REFERENCE", 0,
-                     "Subtraction reference", refFile->filename);
+                     "Subtraction reference", refBase);
+    psFree(refName);
+    psString inName = psStringCopy(inFile->filename);   // Filename of input
+    const char *inBase = basename(inName);              // Basename of input
     psMetadataAddStr(outHDU->header, PS_LIST_TAIL, "PPSUB.INPUT", 0,
-                     "Subtraction input", inFile->filename);
+                     "Subtraction input", inBase);
+    psFree(inName);
+
     ppSubVersionHeader(outHDU->header);
-
 
     outRO->analysis = psMetadataCopy(outRO->analysis, analysis);
