Changeset 38b3baf in mainline for uspace/srv/devman/util.c


Ignore:
Timestamp:
2010-10-23T07:16:14Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7e66a5ec
Parents:
032e0bb
Message:

Cstyle fixes of devman.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/util.c

    r032e0bb r38b3baf  
    3232
    3333#include <stdlib.h>
    34 #include <str.h> 
    35  
     34#include <str.h>
     35
    3636#include "util.h"
    37  
    3837
    39 char * get_abs_path(const char *base_path, const char *name, const char *ext)
     38char *get_abs_path(const char *base_path, const char *name, const char *ext)
    4039{
    4140        char *res;
    4241        int base_len = str_size(base_path);
    43         int size = base_len + 2*str_size(name) + str_size(ext) + 3;     
     42        int size = base_len + 2 * str_size(name) + str_size(ext) + 3;
    4443       
    4544        res = malloc(size);
     
    4746        if (res) {
    4847                str_cpy(res, size, base_path);
    49                 if(base_path[base_len - 1] != '/') {
    50                         str_append(res, size, "/");                     
    51                 }
     48                if (base_path[base_len - 1] != '/')
     49                        str_append(res, size, "/");
    5250                str_append(res, size, name);
    5351                str_append(res, size, "/");
    5452                str_append(res, size, name);
    55                 if(ext[0] != '.') {
     53                if (ext[0] != '.')
    5654                        str_append(res, size, ".");
    57                 }
    58                 str_append(res, size, ext);             
     55                str_append(res, size, ext);
    5956        }
    6057       
     
    6259}
    6360
    64 char * get_path_elem_end(char *path)
     61char *get_path_elem_end(char *path)
    6562{
    66         while (0 != *path && '/' != *path) {
     63        while (0 != *path && '/' != *path)
    6764                path++;
    68         }
    6965        return path;
    7066}
     67
     68/** @}
     69 */
Note: See TracChangeset for help on using the changeset viewer.