Changeset 1241


Ignore:
Timestamp:
Mar 12, 2007, 2:22:55 AM (13 years ago)
Author:
bruno
Message:
  • Fix a bug for tape mangement where block size was missing during extract (Michel Loiseleur)
  • Remove turn_wildcard_chars_into_literal_chars and use mr_stresc instead (based on an idea from Michel)
Location:
branches/stable/mondo/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-filelist.c

    r1224 r1241  
    451451        mr_msg(8, "Analyzing %s", file_to_analyze);
    452452        /* BERLIOS : to be checked */
    453         mr_asprintf(&strtmp, syscall_sprintf, mr_stresc(file_to_analyze, "`$\\\"", '\\'));
     453        mr_asprintf(&strtmp, syscall_sprintf, mr_stresc(file_to_analyze, "`$\\\"", BACKSLASH));
    454454        mr_asprintf(&sys_call, "%s 2>> /dev/null", strtmp);
    455455        mr_free(strtmp);
     
    17091709{
    17101710    int retval = 0;
    1711     struct s_node *found_node;
    1712     FILE *fin;
    1713     FILE *fout;
     1711    struct s_node *found_node = NULL;
     1712    FILE *fin = NULL;
     1713    FILE *fout = NULL;
    17141714    char *fname = NULL;
    1715     char *tmp;
     1715    char *tmp = NULL;
    17161716    size_t len = 0;             // Scrub's patch doesn't work without that
    17171717
     
    17501750                }
    17511751                mr_msg(5, "Found '%s'", fname);
    1752                 turn_wildcard_chars_into_literal_chars(tmp, fname);
     1752                tmp = mr_stresc(fname, WILDCHARS, BACKSLASH);
    17531753                fprintf(fout, "%s\n", tmp);
    17541754                mr_free(tmp);
  • branches/stable/mondo/src/common/libmondo-string-EXT.h

    r1178 r1241  
    3939
    4040extern char *media_descriptor_string(t_bkptype);
    41 
    42 extern inline void turn_wildcard_chars_into_literal_chars(char *out,
    43                                                           char *in);
  • branches/stable/mondo/src/common/libmondo-string.c

    r1195 r1241  
    103103        }
    104104    in_out[i] = '\0';
    105 }
    106 
    107 
    108 inline void turn_wildcard_chars_into_literal_chars(char *strout, char *strin)
    109 {
    110     char *p, *q;
    111 
    112     for (p = strin, q = strout; *p != '\0'; *(q++) = *(p++)) {
    113         if (strchr("[]*?", *p)) {
    114             *(q++) = '\\';
    115         }
    116     }
    117     *q = *p;                    // for the final '\0'
    118105}
    119106
  • branches/stable/mondo/src/common/libmondo-string.h

    r1168 r1241  
    3232char *percent_media_full_comment(struct s_bkpinfo *bkpinfo);
    3333char *media_descriptor_string(t_bkptype);
    34 inline void turn_wildcard_chars_into_literal_chars(char *out, char *in);
  • branches/stable/mondo/src/include/mr_str.h

    r1182 r1241  
    99#define MR_STR_H
    1010
     11/* Constants for mr_stresc */
     12#define WILDCHARS   "[]*?"
     13#define BACKSLASH   '\\'
     14
    1115/* functions (public methods) */
    1216
  • branches/stable/mondo/src/lib/mr_str.c

    r1217 r1241  
    5656 * @note this function allocates memory that needs to be freed by caller
    5757 **/
    58 char *mr_stresc(char *instr, char *toesc, const char escchr)
    59 {
    60 
     58char *mr_stresc(char *instr, char *toesc, const char escchr) {
    6159    char *inptr = NULL;
    6260    char *retstr = NULL;
  • branches/stable/mondo/src/mondoarchive/mondoarchive.c

    r1228 r1241  
    236236        g_text_mode = TRUE;
    237237        setup_newt_stuff();
    238         malloc_string(tmp);
    239         turn_wildcard_chars_into_literal_chars(tmp, argv[2]);
     238        tmp = mr_stresc(argv[2], WILDCHARS, BACKSLASH);
    240239        printf("in=%s; out=%s\n", argv[2], tmp);
    241240        mr_free(tmp);
  • branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c

    r1219 r1241  
    11061106        if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    11071107            mr_asprintf(&command,
    1108                     "tar -zxf %s %s %s %s %s %s",
     1108                    "tar -b %ld -zxf %s %s %s %s %s %s",
     1109                    bkpinfo->internal_tape_block_size,
    11091110                    bkpinfo->media_device,
    11101111                    MOUNTLIST_FNAME_STUB,
     
    11921193        log_to_screen(_("Pre-processing filelist"));
    11931194        if (!does_file_exist(g_biggielist_txt)) {
    1194             mr_asprintf(&command, "> %s", g_biggielist_txt);
     1195            mr_asprintf(&command, "echo -n > %s", g_biggielist_txt);
    11951196            paranoid_system(command);
    11961197            mr_free(command);
Note: See TracChangeset for help on using the changeset viewer.