]> diplodocus.org Git - nmh/blobdiff - sbr/fmt_scan.c
Added test of encoded Resent-To: and Resent-cc:.
[nmh] / sbr / fmt_scan.c
index 436b1ec470f8569133cebdc8e90bda0eddc1b6ce..c5e9877cc47ae2827d9756395a06182022ec457b 100644 (file)
@@ -579,20 +579,25 @@ fmt_scan (struct format *format, charstring_t scanlp, int width, int *dat,
        case FT_LS_ORDINAL:
            {
                int digit = value % 10;
+               int seconddigit = (value / 10) % 10;
                const char *suffix;
 
-               switch (digit) {
-               case 1:
-                   suffix = "st";
-                   break;
-               case 2:
-                   suffix = "nd";
-                   break;
-               case 3:
-                   suffix = "rd";
-                   break;
-               default:
+               if (seconddigit == 1) {
                    suffix = "th";
+               } else {
+                   switch (digit) {
+                   case 1:
+                       suffix = "st";
+                       break;
+                   case 2:
+                       suffix = "nd";
+                       break;
+                   case 3:
+                       suffix = "rd";
+                       break;
+                   default:
+                       suffix = "th";
+                   }
                }
 
                strncpy(buffer, suffix, sizeof(buffer));