Diff of /mcmerge.c [50e528] .. [4e24f1] Maximize Restore

  Switch to unified view

a/mcmerge.c b/mcmerge.c
...
...
8
 * This file implements the `mc_merge' function, which is used by
8
 * This file implements the `mc_merge' function, which is used by
9
 * `gencat' to merge the compiled message dictionary derived from
9
 * `gencat' to merge the compiled message dictionary derived from
10
 * any single source file into its current internal dictionary.
10
 * any single source file into its current internal dictionary.
11
 *
11
 *
12
 * Written by Keith Marshall  <keithmarshall@users.sourceforge.net>
12
 * Written by Keith Marshall  <keithmarshall@users.sourceforge.net>
13
 * Last modification: 12-May-2007
13
 * Last modification: 17-Aug-2007
14
 *
14
 *
15
 *
15
 *
16
 * This is free software.  It is provided AS IS, in the hope that it may
16
 * This is free software.  It is provided AS IS, in the hope that it may
17
 * be useful, but WITHOUT WARRANTY OF ANY KIND, not even an IMPLIED WARRANTY
17
 * be useful, but WITHOUT WARRANTY OF ANY KIND, not even an IMPLIED WARRANTY
18
 * of MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE.
18
 * of MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE.
...
...
144
      cat = mark = input;
144
      cat = mark = input;
145
      mark->link = NULL;
145
      mark->link = NULL;
146
      dfprintf(( stderr, "Initialise message list at set %u message %u\n", mark->set, mark->msg ));
146
      dfprintf(( stderr, "Initialise message list at set %u message %u\n", mark->set, mark->msg ));
147
    }
147
    }
148
      }
148
      }
149
      else if( curr->key == input->key )
149
      else if( curr && (curr->key == input->key) )
150
      {
150
      {
151
    /* The input record refers to a message which is already present
151
    /* The input record refers to a message which is already present
152
     * in the current message list; the operation to be performed is
152
     * in the current message list; the operation to be performed is
153
     * either deletion or replacement.
153
     * either deletion or replacement.
154
     */
154
     */
...
...
219
      input->link = curr->link;
219
      input->link = curr->link;
220
      free( curr );
220
      free( curr );
221
      mark = input;
221
      mark = input;
222
    }
222
    }
223
      }
223
      }
224
      else
224
      else if( curr )
225
      {
225
      {
226
    /* There is no existing reference with set and message numbers
226
    /* There is no existing reference with set and message numbers
227
     * matching the current input record; thus the input record must
227
     * matching the current input record; thus the input record must
228
     * be inserted between the existing `mark' and `curr' entries.
228
     * be inserted between the existing `mark' and `curr' entries.
229
     */
229
     */
...
...
251
     * successor to the inserted entry.
251
     * successor to the inserted entry.
252
     */
252
     */
253
    dfprintf(( stderr, "before set %u message %u\n", curr->set, curr->msg ));
253
    dfprintf(( stderr, "before set %u message %u\n", curr->set, curr->msg ));
254
    input->link = curr;
254
    input->link = curr;
255
      }
255
      }
256
#     ifdef DEBUG
257
      else
258
      {
259
  /* There is no `curr' record and the input record has not been
260
   * appended; this must be a delete request, with nothing to act on,
261
   * so we simply ignore it.
262
   */
263
  dfprintf(( stderr, "Ignore delete request for non-existent message\n" ));
264
      }
265
#     endif
256
    }
266
    }
257
267
258
    else if( input->set && (input->base == NULL) )
268
    else if( input->set && (input->base == NULL) )
259
    {
269
    {
260
      /* This is a a `delset' operation; it will delete all messages
270
      /* This is a a `delset' operation; it will delete all messages
...
...
364
   * we return the resultant message catalogue index to the caller.
374
   * we return the resultant message catalogue index to the caller.
365
   */
375
   */
366
  return cat;
376
  return cat;
367
}
377
}
368
378
369
/* $RCSfile$Revision: 1.2 $: end of file */
379
/* $RCSfile$Revision: 1.3 $: end of file */